[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
|
||||
Posts: 8
Hi, that's a really GOOD Module, I had some probs with Multisite, pls. see Wiki..
Posts: 1
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
Posts: 314
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
Posts: 32
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
Posts: 314
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
Posts: 34
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.
Posts: 314
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
Posts: 6
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]
Posts: 314
Show/Render a file in a block
serbanc - www.e-poze.ro
Posts: 27300
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
Posts: 3
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.
Posts: 3
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!)
Posts: 27300
The docs are for users by users.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 94
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,
Posts: 314
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
Posts: 5
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.
Posts: 314
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
Posts: 5
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
Posts: 314
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
Posts: 5
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}
Posts: 314
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
Posts: 17
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
Posts: 154
I use G2.3 . Where i can found 'minicms' in e-poze.ro?
Posts: 314
http://www.e-poze.ro/downloads/
serbanc - www.e-poze.ro
Posts: 31
I got minicms from sourceforge. I've used it in Coppermine. It worked great there.
Posts: 31
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.
Posts: 31
Oops. Got it. The htmlblock that is. Still don't see minicms
Posts: 3
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?
Posts: 71
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.