Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 07:33 am EDT

Geeklog Forums

Modifying blocks


Status: offline

dwl

Forum User
Junior
Registered: 01/05/11
Posts: 25
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?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

dwl

Forum User
Junior
Registered: 01/05/11
Posts: 25
Hi Dirk,

Hope this clarifies things

Quote by: Dirk

Not 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.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
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
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
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
One of the Geeklog Core Developers.
 Quote

Status: offline

dwl

Forum User
Junior
Registered: 01/05/11
Posts: 25
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: 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

 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
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
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

dwl

Forum User
Junior
Registered: 01/05/11
Posts: 25
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%3ABen

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

 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
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
One of the Geeklog Core Developers.
 Quote

Status: offline

dwl

Forum User
Junior
Registered: 01/05/11
Posts: 25
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: 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

 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
No problem, it happens to all of us Big Grin

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.
One of the Geeklog Core Developers.
 Quote

All times are EDT. The time is now 07:33 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content