Results 1 to 3 of 3
  1. #1

    link problem Help using zen_href_link() for new module.

    Hi php-zen heads,

    I've been slaving away over a tag cloud module that I think everyone will like, but I'm having trouble getting it finished.

    I need to create links for each word in the tag cloud. Up till now I have hard coded a link for testing. However this won't work if others want to used the code.

    I know its possible to use the zen_href_link() function, but I can't find any good examples for my purpose.

    Code:
    $return .= '<a class="category-top" href="http://www.mysite.com/zen/index.php?main_page=index&cPath=';
                        $return .= $this->name_idst[$key+1]; // link for catagory
                        $return .= '">';
                        $return .= "<span class='word size{$sizeRange}'> &nbsp; {$word} &nbsp; </span></a>";
    As you can see I've hard coded my demo site as a string for testing. While $this->name_idst[$key+1] is returning the key id from an array.

    Does anyone have a neat solution for this? Or perhaps some references to examples or some documentation for the function.

    Cheers,

    Nathan

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Help using zen_href_link() for new module.

    How about this:
    Code:
                        $return .= '<a class="category-top" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $this->name_idst[$key+1]) . '">';
                        $return .= "<span class='word size{$sizeRange}'> &nbsp; {$word} &nbsp; </span></a>";
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3

    Idea or Suggestion Re: Help using zen_href_link() for new module.

    Thanks DrByte,
    It worked a treat. I think I was just to tide from the late nights learning php by trail and error to figure out that function. Seams easy enough now ;).

    Anyhow if your interested check out my site for the alpha version of ZenTagCloud... the title has a nice ring to it I think.

    http://www.madteckhead.com/blog/zentagcloud/

 

 

Similar Threads

  1. v150 Help needed for Creating New Payment Module
    By vkd1980 in forum Addon Payment Modules
    Replies: 9
    Last Post: 12 Sep 2013, 08:00 AM
  2. Help for Function zen_href_link for an image
    By doriggidy in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 26 Jul 2012, 01:24 PM
  3. relative links using zen_href_link
    By doug949 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 17 Oct 2008, 03:34 AM
  4. Help for new payment module - v-p gateway
    By jp100 in forum Addon Payment Modules
    Replies: 1
    Last Post: 8 Feb 2008, 10:57 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