Results 1 to 3 of 3

Thread: Global catalog variable

  1. #1
    User
    Join Date
    07-01-09.
    Posts
    91

    Default Global catalog variable

    I think this is simple, but, maby not. What I would like to do is have something set on the back end that would act as a custom "setting" for my catalog(s). I'm building a product catalog and I would like to have the ability to set something that can be read globally by all items.

    Example, Have a Back end option for the whole catalog where I say "Store Active: X" .

    In my catalog reader template, I could have something like:

    Code:
    <?php if ($varStoreActive): ?> 
    // Do stuff
    <?php endif; ?>
    It's easy to set options on a per entry level, but, adding the global option would be REALLY helpful( It may already exist and I'm being stupid by not seeing it).

    Thank you for your help.

  2. #2
    User MacKP's Avatar
    Join Date
    06-19-09.
    Location
    Duisburg (Germany)
    Posts
    211

    Default Re: Global catalog variable

    For global Operations Contao has the global Variable ;-)

    Here is an example :
    Code:
    <?php if(strlen($this->Input->get('kategorie')))
    {
       global $objPage;
       $objPage->pageTitle = "".$entry['data']['kategorie']['value']." - XYZ";  
    }
    ?>
    Here the title would be set to the current kategorie of an Item.

    Maybe this helps...

    regards
    Mediendepot Ruhr
    For real-time chat the (inofficial) Chatroom in IRC:
    -> irc.freenode.net #contao | irc.freenode.net #contao.de

  3. #3
    User
    Join Date
    07-01-09.
    Posts
    91

    Default Re: Global catalog variable

    Oohhh, ok, that will come in handy. I guess now the next step is to work on adding a variable to the global list and making it editable from the Back end.

    Thank you MackP.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •