Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jun 2007
    Posts
    10
    Plugin Contributions
    0

    Default Category URL from zen_href_link

    Hello,

    I am trying to set up a series of footer links on my pages using product and category IDs. I am using zen_href_link() to get the full url from the ID - it works for products, but I cant get it to work for categories. Can anyone tell me what parameters to use in zen_href_link when the only info I have to pass to it is the category ID ?

    Many thanks

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Category URL from zen_href_link

    Are these static hard links for the footer?
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jun 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: Category URL from zen_href_link

    Both.
    I have set up a database table, foot_links which contains link text, plus either product.id, category.id or fixed url.
    In tpl_footer I then read the table and create the url link.
    Creating the product url like this
    $url = zen_href_link(zen_get_info_page($links->fields['product']) , 'products_id=' . $links->fields['product'] . $product_url_add, 'NONSSL', false);

    Works fine, but I cant figure out how to get the category url using this function.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Category URL from zen_href_link

    Have a look at includes/functions/functions_categories.php and possibly categories_name
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Jun 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: Category URL from zen_href_link

    Many thanks, found the answer. In case anyone is looking and wants to know, the function should be

    $url = zen_href_link('index', zen_get_path($links->fields['category']));

  6. #6
    Join Date
    Apr 2007
    Location
    Orange County, CA
    Posts
    88
    Plugin Contributions
    5

    Default Re: Category URL from zen_href_link

    Is it possible to specify a certain category? If I wanted to create a link as above, but have it go directly to cPath=123, how would that be coded?

  7. #7
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Category URL from zen_href_link

    Quote Originally Posted by gezuvor
    If I wanted to create a link as above, but have it go directly to cPath=123, how would that be coded?
    use the href="index.php?main_page=index&cPath=123"
    This for a relative hard code link
    Zen-Venom Get Bitten

  8. #8
    Join Date
    Apr 2007
    Location
    Orange County, CA
    Posts
    88
    Plugin Contributions
    5

    Default Re: Category URL from zen_href_link

    I am using that now, but it's not smart enough to discern between http and https pages, so the links in my categories sidebox are always http and my header/footer "hard links" are https when accessed from a secure page. I'm trying to use more elegant programming to allow these new links to behaving in a more native ZC fashion...

  9. #9
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Category URL from zen_href_link

    Quote Originally Posted by gezuvor
    the links in my categories sidebox are always http
    Exactly as this should be - - one usually does not want to run the catalog as htpps

    Quote Originally Posted by gezuvor
    my header/footer "hard links" are https when accessed from a secure page
    Would have to see this in action
    Zen-Venom Get Bitten

  10. #10
    Join Date
    Apr 2007
    Location
    Orange County, CA
    Posts
    88
    Plugin Contributions
    5

    Default Re: Category URL from zen_href_link

    I will call you with the access information and post the results back here for others...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v153 URL from category page (at bottom) not working
    By okieannie in forum General Questions
    Replies: 1
    Last Post: 16 May 2015, 05:10 PM
  2. v153 URL rewriting from Ceon to Utimate URL.
    By robbie269 in forum General Questions
    Replies: 40
    Last Post: 11 Jan 2015, 11:43 PM
  3. change category to sub category- keep URL?
    By Cinzia in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 21 Mar 2011, 02:59 PM
  4. 2 page URL in category issue with Simple SEO URL Manager
    By msladybug02 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 19 Nov 2010, 10:33 PM
  5. zen_href_link
    By nikfiend in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 8 Jun 2010, 11:09 PM

Posting Permissions

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