Results 1 to 4 of 4

Thread: Category help

  1. #1
    Join Date
    Feb 2008
    Posts
    23

    Default Category help

    Hi,
    im trying to include a weather script from another site into my detail_link.
    Now in the script i want to specify the place by using the info from the category but i dont know the code to do this.
    EXAMPLE
    Top>Bourton On The Water>Accommodation

    I need the code to capture the Bourton On The water bit, ie the first Category.
    Is it <$category$> ?
    i tried the above and it didnt seem to work, is it <$cat_1$> or something similar?
    Any help much appreciated.

  2. #2
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    You need to use <%$whateverhere$> so give <%$category%> a try

  3. #3
    Join Date
    Feb 2008
    Posts
    22

    Default

    Try this one on your detail_link.html template :
    <%php%>
    $cats = explode(' > ', $this->get_template_vars('category_path'));
    $this->assign('main_cat_name', $cats[0]);
    <%/php%>
    Now, the first category should be available in <%$main_cat_name%> var.
    Hope it helps.

  4. #4
    Join Date
    Feb 2008
    Posts
    23

    Default

    Quote Originally Posted by seveneth View Post
    Try this one on your detail_link.html template :


    Now, the first category should be available in <%$main_cat_name%> var.
    Hope it helps.
    I give that a try tonight, Thanks for your help.

Similar Threads

  1. Replies: 2
    Last Post: 01-02-2008, 07:25 AM
  2. Replies: 6
    Last Post: 06-02-2005, 09:08 AM

Posting Permissions

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