Posted on: 05/16/11 03:16pm
By: dwl
I'm new to Geeklog and Smarty templates in general.
I have read the tutorials for theming as to the basic thtml structure of Geeklog but the changes I want to make are to the blocks in parentheses - {}. I want to do some custom theming and need to modify the blocks that appear in the left hand side. If I want to modify how a chunk or block of data is turned out by Geeklog, where do I start in file structure to do so?
Re: Modifying blocks
Posted on: 05/16/11 03:52pm
By: Dirk
Not sure I understand what exactly you're trying to do.
Each block on the left and right side consists of the actual content, sandwiched between a block header and a block footer. Per default, all blocks use the same header and footer templates, but you can
override those and, if you want, give each block a different layout.
Does that help?
bye, Dirk
Re: Modifying blocks
Posted on: 05/16/11 04:48pm
By: dwl
Hi Dirk,
Hope this clarifies things
Quote by: DirkNot sure I understand what exactly you're trying to do.
From the header.thtml file there's this snippet of code
<div class='header-navigation-container clearfix'>
<ul>
{menu_elements}
</ul>
</div><!-- /header-navigation-container clearfix -->
How would I go about editing the code for how {menu_elements} is returned as an HTML block? This is only a small example. The key is that I wish to know where to start looking to edit blocks like {menu_elements}.
Hope you're having a good day,
D.
Re: Modifying blocks
Posted on: 05/16/11 05:17pm
By: Dirk
We call those template variables. You can't really change the existing ones, but in many situations, you can define your own. There's a function CUSTOM_templateSetVars() in system/lib-custom.php that shows how to do that.
See if that's more like what you had in mind.
bye, Dirk
Re: Modifying blocks
Posted on: 05/17/11 06:50am
By: ::Ben
How would I go about editing the code for how {menu_elements} is returned as an HTML block?
Can you tell us what do you want to do ? We certainly get a plugin or theme solution here.
Ben
Re: Modifying blocks
Posted on: 05/17/11 02:37pm
By: Laugh
The menu_elements template variable does break down into a few more templates. Take a look at the files:
menuitem.thtml
menuitem_last.thtml
menuitem_none.thtml
Tom
Re: Modifying blocks
Posted on: 05/17/11 06:10pm
By: dwl
Thanks, Tom. That almost answer what I want to do. I am also looking ways to get higher up in the DOM. While you have shown it's possible to modify menu items, how would I access the code to modify the <ul> governing the menu items? I may want to give it a class or an id.
If I examine leftblocks.thtml, I have this
<div class="block-bg-left">
{geeklog_blocks}
<div class="block-bg-spreader"></div>
</div>
The variable {geeklog_blocks} ends up being a lot of code.
It amounts to that I am trying to get my head around how things work in order to follow the logic.
Good of you to take the time to reply.
D.
Quote by: LaughThe menu_elements template variable does break down into a few more templates. Take a look at the files:
menuitem.thtml
menuitem_last.thtml
menuitem_none.thtml
Tom
Re: Modifying blocks
Posted on: 05/18/11 03:19am
By: ::Ben
You can use jQuery to add a class to the ul tag or add the class directly in the layout/professional/header.thtml file.
Ben
Re: Modifying blocks
Posted on: 05/18/11 07:53am
By: dwl
I think you need to go back and look at the template files, Ben. If it was that easy to edit the <ul> tags in the template files I wouldn't be posting here.
When the variable is returned, the tags for a menu comprising a set of li items has the <ul>-</ul>.
For jQuery solutions,. it is sometimes necessary to hard-code the class or id for a <ul>. Which is the reason why I am posting the question: 'How do I access those variables so I can modify something higher up the DOM than the <li> tag?'
Quote by: %3A%3ABenYou can use jQuery to add a class to the ul tag or add the class directly in the layout/professional/header.thtml file.
Ben
Re: Modifying blocks
Posted on: 05/18/11 08:15am
By: Laugh
Hey dwl,
When I look at the header.thml file from the professional theme the menu_elements variable is wrapped in the ul tag. The ul tag is accessible to theme developers. Are you looking at a different theme (that may be older)?
Text Formatted Code
<div class="header-navigation-container clearfix">
<ul>
{menu_elements}
</ul>
</div>
Tom
Re: Modifying blocks
Posted on: 05/18/11 08:58am
By: dwl
Damn, I was looking at the wrong file. My apologies, Ben.
Excuse while I take a time-out in the corner and try to get my foot out of my mouth.
Quote by: LaughHey dwl,
When I look at the header.thml file from the professional theme the menu_elements variable is wrapped in the ul tag. The ul tag is accessible to theme developers. Are you looking at a different theme (that may be older)?
Text Formatted Code
<div class="header-navigation-container clearfix">
<ul>
{menu_elements}
</ul>
</div>
Tom
Re: Modifying blocks
Posted on: 05/18/11 11:23am
By: Laugh
No problem, it happens to all of us
When you finish your theme or if you want feedback please post a link to your site. We are always happy to see more Geeklog theme developers.