Log on:
Powered by Elgg

ELGG Template :: Blog :: Modifying {{keywords}} in templates

October 11, 2006

Hi,

I am trying to figure out how templates work and I have found my way so far in modifying most of the elements of a template.

But there is still one thing that I can't understand:

Let's say we are not happy with the sidebar blocks (on the right of the template). We want to modify them. Then we go to the template default file and we find a {{sidebar}} tag which displays all the blocks in a certain order.

If I want to modify one special block. Then it's quite easy to find the file to be edited. I make a little search in the unit dir.

But if I want to modify, let's say, the order of the blocks (or if I want to add or delete a block), then I need to figure out where the {{sidebar}} part is defined. My problem is that I can't understand where and how these components - {{sidebar}} {{location}} ... - are defined.

Any help would be appreciated

Thanks  in advance

Posted by ELGG Template - geraud


Comments

  1. I just thought about asking the same Question :-). I think there is no possibility to change the order of blocks, or with other words the order of the elements inside an keyword element (e.g. the {{mainbody}} or the {{sidebar}} element).

    I don't know if the developers like to change that generally. We must think about which parts of a template should always be in the same position and which may be changed by a individual template design.

    • Your Dashboard
    • Your Blog
    • Your Files
    • Your Network
    • Your Resources
    • Your Profile

    These are Elements which refer to the visitor. But they are shown in the style of the weblog/community owner. Is that useful? Or how can it be more obvious? Perhaps there could be a small horizontal Page element, call it header if you like, that shows these Option, the Account Setting Option and the logoff button. These Element should be styled i a coherent way on every Page, because it is not related to the blog/community that is shown.

    Apart of that, and to come back to your question, it would be nice if there are more keywords. E.g. there should be a possibility to change the order of the elements in a blog post. Perhaps some user want to have the title at first position, and the date below. A more "granular" Keyword-Set would be nice. (Or did i miss another possibility for doing that?) 

    Matthias G.Matthias G. on Wednesday, 11 October 2006, 20:00 CEST # |

  2. Sorry, i forgot something: If you just want to "delete" an element. That's possible with CSS:

    just define the id or class as:

    display:hidden; 

    Matthias G.Matthias G. on Wednesday, 11 October 2006, 20:11 CEST # |

  3. You'll both hopefully be pleased to hear that we're going to move over to a widget system for the sidebar, so users can place any item from a selection in any order. This should make life a bit easier in this regard.

    Ben WerdmullerBen Werdmuller on Wednesday, 11 October 2006, 22:04 CEST # |

  4. Yes.

    But anyway I would be very pleased to know how these {{keywords}} work (and where I can find the code that handle them).

    Because I want to make a special use of ELGG and I need to rewrite a lot of things.

    geraudgeraud on Thursday, 12 October 2006, 00:31 CEST # |

  5. Yes Widgets are cool. But they aren't used to build a more granular {{mainbody}} Element? Is it possible to change the order of the elements inside the {{mainbody}} Element?  Or is such a feature planned?

    And what do you think about a ELGG.net wide coherent style for the Menu element? (see previous comment)

     

    Matthias G.Matthias G. on Thursday, 12 October 2006, 08:39 CEST # |

  6. I found it !!!

    Here is how it works:

    The {{sidebar}} is constructed using $function[display:sidebar][] 

    Each time, you see  "$function[display:sidebar][] = something" in the code, it adds a block to the sidebar.

    The order of the blocks depends on the order of these  "$function[display:sidebar][] = something" calls.

    And it is set in... includes_system.php  

    If you change the order of the includes in this file, then the order of the blocks will change the same way.

    Hope it will help other geeks ;-)

    geraudgeraud on Friday, 13 October 2006, 10:12 CEST # |

You must be logged in to post a comment.