[new module] HTML Block - edit and display your HTML pages and/or TPL pages

serbanc

Joined: 2006-05-19
Posts: 314
Posted: Thu, 2008-01-10 23:56

Developed a module to display HTML blocks and pages and/or TPL pages.

usage, instructions: http://codex.gallery2.org/Gallery2:Modules:htmlblock

serbanc - www.e-poze.ro

AttachmentSize
htmlblock.zip708.73 KB
 
CumGranoSalis
CumGranoSalis's picture

Joined: 2008-02-18
Posts: 8
Posted: Wed, 2008-02-20 17:16

Hi, that's a really GOOD Module, I had some probs with Multisite, pls. see Wiki..

 
slm4996

Joined: 2008-02-21
Posts: 1
Posted: Thu, 2008-02-21 05:00

Hello everyone. I had a few issues getting this setup. After searching for hours I have found this:

the FrontPage.tpl file goes in the /yoursitename.com_gallery_g2data/plugins_data/modules/htmlblock Folder

here is how I hound that
http://gallery.menalto.com/node/71842

Hope this helps others

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Thu, 2008-02-21 09:17

right!
normally, you should create the file FrontPage.tpl using internal editor; it will be saved in the right place.

serbanc - www.e-poze.ro

 
zepdad60

Joined: 2008-07-24
Posts: 32
Posted: Sat, 2008-08-02 12:10

Receive error when saving new file:

PHP Warning: unlink(D:\Domains\zeppelinart.com\g2data\plugins_data\modules/htmlblock\frontpage.tpl) [<a href='function.unlink'>function.unlink</a>]: No such file or directory in D:\Domains\zeppelinart.com\wwwroot\gallery2\modules\core\classes\GalleryPlatform.class on line 502

Despite the warning, the file is saved. I do not have URL_Rewrite activated because the function is not available on my Windows host. Is this the problem? Or could this be a compatibility issue with 2.3RC1? Maybe a simple bug?

www.zeppelinart.com
The home of Led Zeppelin bootleg art

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Sun, 2008-08-03 21:47

no, nothing to do with url rewrite.
it is related to filesystem/operating system.
it could be a bug.

never tested on windows. if it appears every time, it is a bug, if it appears only the first time, it is normal (the module does not create the initial FrontPage.tpl). Please note that the module searches for a FrontPage.tpl file not for frontpage.tpl)

serbanc - www.e-poze.ro

 
rredmon
rredmon's picture

Joined: 2004-07-06
Posts: 34
Posted: Sat, 2008-08-16 16:27

This looks like an excellant module. I'm having a basic novice issue.

Following the directions at http://codex.gallery2.org/Gallery2:Modules:htmlblock, I installed and activated HTML Block, then I made a trivial html file (htmlblock_test.html) with the embedded editor and attempted to apply it to an album via adding the block "Show/Render a file in a block" to Album=>Edit=>Theme=>"Blocks to show on album pages". What do I put for the "Name of the file" parameter? Relative path, absolute path? I tried a variety and never did see this basic HTML block displayed on the Album page.

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Sun, 2008-08-17 20:41

name of the file: just the filename, in the form filename.ext

1. I encountered some issues with G2.3.

serbanc - www.e-poze.ro

 
say2paul

Joined: 2008-08-14
Posts: 6
Posted: Tue, 2008-08-26 09:42

I encountered a very strange issue after installing HTML Block to my Gallery2 (both on Windows and Linux). The issue is that I am unable to see an option to add HTML Block to the sidebar.

For more information please refer to the below image. Can anyone help me on how to overcome this issue?

[img]http://www.mobileturner.com/design1.jpg[/img]

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Tue, 2008-08-26 09:54

Show/Render a file in a block

serbanc - www.e-poze.ro

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2008-08-26 13:49

say2paul,
please update the documentation on the codex http://codex.gallery2.org/Gallery2:Modules:htmlblock
to reflect your findings. Your way of giving back to the project.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
schoolboy

Joined: 2006-12-20
Posts: 3
Posted: Wed, 2008-09-10 17:12

I can't get this to work in gallery 2.2.5 . Have successfully loaded and installled the module, and have already created a test file "test.html", but I cannot get the file to appear in the side column, the album pages, or the photo pages.

 
schoolboy

Joined: 2006-12-20
Posts: 3
Posted: Wed, 2008-09-10 17:45

Okay... I figured it out...

Once installed, under the THEME option in site admin, select the block to display... and THEN, input the html filename in the subsequent input field...

(A good, step-by-step README file, included in the mod download, would be very helpful. Current instructions are a little vague... For newbies, we need LOTS of help!)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2008-09-10 18:02
Quote:
Current instructions are a little vague...

floridave wrote:
say2paul,
please update the documentation on the codex http://codex.gallery2.org/Gallery2:Modules:htmlblock
to reflect your findings. Your way of giving back to the project.

The docs are for users by users.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
maxbuzz

Joined: 2008-09-25
Posts: 94
Posted: Fri, 2008-09-26 04:10

Hi,

Am following the example 1 in http://codex.gallery2.org/Gallery2:Modules:htmlblock
installed the module, created the tpl file and can see the same in ..\gallery\g2data\plugins_data\modules\htmlblock directory.

Now I have a couple of questions
1. Where do I put in my HTML file
2. How do I re-direct my entry page to this tpl

Thanks,

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Fri, 2008-09-26 07:16

Guys, no offence!
I developed the module, I released it to the community. I do not have "documentation" skills. take it as-is.

Please fell free to change the codex page as you think/feel that it is the best for users!

Regards,
serbanc - www.e-poze.ro

 
james147

Joined: 2009-01-20
Posts: 5
Posted: Tue, 2009-01-20 02:03

Looking for a way to set permissions for the HTML pages, or at least do a check if the user is registered. If the user is registered, display the html file, if not display login block. Sounds possible, but new to gallery and php. Any help appricated.

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Tue, 2009-01-20 08:06

there are no permissions on the html block
use something like
{if $user.isGuest}
Hello guest
{g->block type="core.LoginBlock" ...}
{else}
Hello returning user
Your username is {$user.userName}
{/if}

serbanc - www.e-poze.ro

 
james147

Joined: 2009-01-20
Posts: 5
Posted: Wed, 2009-01-21 01:45

Odd issue with this code that i don't understand. When naming the file w/.tpl I get a blank gallery page with "Hello returning user Your username is guest" in the body. And when using w/.php gallery renders the page with blocks and systemlinks, but no body. Not sure why gallery is rendering everything after the {else} statement, but not before. Also, I tried just using only {g->block type="core.LoginBlock"}, gallery prints a blank body. Are there only certain blocks that working with this plugin, or should I be able to display any block? Thx. J

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Wed, 2009-01-21 08:05

this module is able to display roughly any block.
roughly - because not all the variables are set by the module (eg. $theme, $item)

in order to interpret smarty, the file needs to be named with .tpl

if /else problem: check syntax, should work.
serbanc - www.e-poze.ro

 
james147

Joined: 2009-01-20
Posts: 5
Posted: Thu, 2009-01-22 00:24

Just wanted to update a workaround that I found for setting password protect on html blocks. I wasn't able to figure out why {g->block type="core.LoginBlock"}, could not be called into the block.

{if ($user.userName) eq "guest"}

{* System Links and Breadcrumb *}
{g->block type="core.SystemLinks"
order="core.SiteAdmin core.YourAccount core.Login core.Logout"
othersAt=1}
</div>
<div class="gbBreadCrumb">
{g->block type="core.BreadCrumb"}
</div>
</div>

{* Gallery Login Block raw code from LoginBlock.tpl *}
<form action="/gallery2/gallery2embedded.php" method="post" id="userAdminForm"
enctype="application/x-www-form-urlencoded">
<div>
<input type="hidden" name="g2_navId" value="xc5de1e9b"/>
<input type="hidden" name="g2_formUrl" value="/gallery2/gallery2embedded.php?g2_view=core.UserAdmin&g2_subView=core.UserLogin"/>
<input type="hidden" name="g2_authToken" value="3d4eee3fcd5a"/>

<input type="hidden" name="g2_controller" value="core.UserLogin"/>
<input type="hidden" name="g2_form[formName]" value="UserLogin"/>
</div>
<table width="100%" cellspacing="0" cellpadding="0">
<tr valign="top">
<td id="gsSidebarCol"><div id="gsSidebar" class="gcBorder1">
<div class="gbBlock">
<h2> User Options </h2>

<ul>
<li class="gbAdminLink gbLink-register_UserSelfRegistration">
<a href="/gallery2/gallery2embedded.php?g2_view=core.UserAdmin&g2_subView=register.UserSelfRegistration">
Register
</a>
</li>
<li class="gbAdminLink gbLink-core_UserLogin">
Login
</li>
</ul>
</div>
<div class="block-core-NavigationLinks gbBlock">
<h3> Navigation </h3>
<ul>
<li>

<a href="/gallery2/gallery2embedded.php?&g2_fromNavId=xc5de1e9b">
Back
</a>
</li>
</ul>
</div>
</div></td>
<td>
<div id="gsContent" class="gcBorder1">
<div class="gbBlock gcBackground1">
<h2> Login to your account </h2>
</div>
<input type="hidden" name="g2_return" value="/gallery2/gallery2embedded.php?"/>
<input type="hidden" name="g2_form[returnUrl]" value="/gallery2/gallery2embedded.php?"/>

<div class="gbBlock">
<h4> Username </h4>
<input type="text" id="giFormUsername" size="16"
name="g2_form[username]" value=""/>
<script type="text/javascript">
document.getElementById('userAdminForm')['g2_form[username]'].focus();
</script>
<h4> Password </h4>
<input type="password" id="giFormPassword" size="16" name="g2_form[password]"/>
</div>

<div class="gbBlock">
Lost or forgotten passwords can be retrieved using the <a href="/gallery2/gallery2embedded.php?g2_view=core.UserAdmin&g2_subView=core.UserRecoverPassword&g2_return=%2Fgallery2%2Fgallery2embedded.php%3Fg2_view%3Dcore.UserAdmin%26g2_subView%3Dcore.UserLogin%26">recover password</a> page

</div>
<div class="gbBlock gcBackground1">
<input type="submit" class="inputTypeSubmit"
name="g2_form[action][login]" value="Login"/>
<input type="submit" class="inputTypeSubmit"
name="g2_form[action][cancel]" value="Cancel"/>
</div>
</div>
</td>
</tr>
</table>
</form>
</div>
{else}
{* display a HTML file *}
{/if}

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Fri, 2009-01-23 08:13

One thing:
If you are using G2.3, then HTMLblock will not allow you the inclusion of the blocks (for whatever reason, some paths/logic in template loading classes were changed in g2.3)

If this is the case, use minicms. available in /downloads section of e-poze.ro

serbanc - www.e-poze.ro

 
mukunku

Joined: 2008-09-10
Posts: 17
Posted: Fri, 2010-02-05 18:07

Hi,
I need help setting permission to the html block.I kinda checked the sidbar.tpl and theme.tpl and the posts above,but I'm not that good at coding..

If someone could guide on how to set permissions to the blocks so only logined members can see them,that would be greatly appreciated.

Thanks in advance

 
Astor

Joined: 2005-12-15
Posts: 154
Posted: Tue, 2009-02-17 16:22
serbanc wrote:
One thing:
If you are using G2.3, then HTMLblock will not allow you the inclusion of the blocks (for whatever reason, some paths/logic in template loading classes were changed in g2.3)

If this is the case, use minicms. available in /downloads section of e-poze.ro

serbanc - www.e-poze.ro

I use G2.3 . Where i can found 'minicms' in e-poze.ro?

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Tue, 2009-02-17 17:02
 
erika_conn

Joined: 2010-01-29
Posts: 31
Posted: Fri, 2010-02-12 11:14

I got minicms from sourceforge. I've used it in Coppermine. It worked great there.

 
erika_conn

Joined: 2010-01-29
Posts: 31
Posted: Fri, 2010-02-12 16:56

Can somebody tell me why, after having uploaded the modules (htmlblock & minicms) and placed them in the Modules folder, I can't activate them in admin/plugins? Isn't that how it's supposed to work? I can't find them anywhere in the admin page.

 
erika_conn

Joined: 2010-01-29
Posts: 31
Posted: Fri, 2010-02-12 17:05

Oops. Got it. The htmlblock that is. Still don't see minicms

 
me_54m

Joined: 2010-07-13
Posts: 3
Posted: Sat, 2010-07-17 22:02

I am using Gallery 2 with e107 which the gallery is embedded into. However I cant get the HTMLBLOCK pages to show in the gallery two pane, when the link is clicked it just opens on a page of its without my site. Any ideas?

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Sun, 2010-08-01 18:39

use this module
http://codex.gallery2.org/Gallery2:Modules:minicms
http://gallery.menalto.com/node/82939

it is better and it has the option that you want.