Welcome to Geeklog Monday, October 23 2017 @ 10:06 pm EDT


Status: offline

dwl

Forum User
Junior
Registered: 05/01/2011
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?

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/2002
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

Status: offline

dwl

Forum User
Junior
Registered: 05/01/2011
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
HTML Formatted 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.

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/2002
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

Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/2005
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

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/2005
Posts: 1232
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.

Status: offline

dwl

Forum User
Junior
Registered: 05/01/2011
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
HTML Formatted Code

<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


Status: offline

::Ben

Forum User
Full Member
Registered: 14/01/2005
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

Status: offline

dwl

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


Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/2005
Posts: 1232
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)?

PHP Formatted Code

    <div class="header-navigation-container clearfix">
        <ul>
            {menu_elements}
        </ul>
    </div>



Tom
One of the Geeklog Core Developers.

Status: offline

dwl

Forum User
Junior
Registered: 05/01/2011
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)?

PHP Formatted Code

    <div class="header-navigation-container clearfix">
        <ul>
            {menu_elements}
        </ul>
    </div>



Tom


Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/2005
Posts: 1232
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.

All times are EDT. The time is now 10:06 pm.

  • 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