Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2007
    Location
    Safford, AZ
    Posts
    323
    Plugin Contributions
    0

    Default Where to add code so it shows on every page?

    Hello,

    I am trying to add some code for a Tag Cloud. My good friend helped me by telling me to add the code to tpl_main_page.php, which I have done and it's working just fine on the main page. However, I would like this to show on every page. Which file would I need to add my code for this to be accomplished?

    Here is my code:

    PHP Code:
    <?
    /* Start TagCloud */
     require_once(DIR_WS_MODULES . 'tagcloud/m1_tagcloud.php');
     echo insertTagCloud(1, "DESC");
     /* End TagCloud */
    ?>
    I tried adding it to the tpl_footer.php but it only showed on the main page.

    Thank you,
    Steve
    Zen cart version: 1.3.9h

  2. #2
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Where to add code so it shows on every page?

    In the tpl_footer.php or tpl_mainpage

    these are part of every page
    Zen cart PCI compliant Hosting

  3. #3
    Join Date
    Oct 2007
    Location
    Safford, AZ
    Posts
    323
    Plugin Contributions
    0

    Default Re: Where to add code so it shows on every page?

    Is there a specific area on these files I should place the code? I tried it on both and it only showed on the main page.
    Steve
    Zen cart version: 1.3.9h

  4. #4
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Where to add code so it shows on every page?

    the verry bottom ot the tpl_footer.php
    Zen cart PCI compliant Hosting

  5. #5
    Join Date
    Oct 2007
    Location
    Safford, AZ
    Posts
    323
    Plugin Contributions
    0

    Default Re: Where to add code so it shows on every page?

    Thank you Merlin. I just removed it from tpl_main_page and added it to the very bottom of tpl_footer. When I click on a category or a product it still isn't showing on the bottom of the page. I am baffled because I thought it should be showing. That is why I tried it originally in the tpl_footer.

    I may just end up leaving it alone? It is strange though.
    Steve
    Zen cart version: 1.3.9h

  6. #6
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Where to add code so it shows on every page?

    try changing
    require_once(DIR_WS_MODULES . 'tagcloud/m1_tagcloud.php');


    to

    require(DIR_WS_MODULES . 'tagcloud/m1_tagcloud.php');
    Zen cart PCI compliant Hosting

  7. #7
    Join Date
    Oct 2007
    Location
    Safford, AZ
    Posts
    323
    Plugin Contributions
    0

    Default Re: Where to add code so it shows on every page?

    The following error is received when on a product page:

    Fatal error: Cannot redeclare inserttagcloud() (previously declared in /home/swiker2/public_html/values-galore/includes/modules/tagcloud/m1_tagcloud.php:66) in /home/swiker2/public_html/values-galore/includes/modules/tagcloud/m1_tagcloud.php on line 0
    no worries ... I will just be happy with them on the main page. I appreciate you going through this with me.
    Steve
    Zen cart version: 1.3.9h

 

 

Similar Threads

  1. Main page shows in every category which has a subcategory
    By bangsters in forum General Questions
    Replies: 5
    Last Post: 20 Jul 2011, 02:07 PM
  2. Adding code to every product page
    By flamer in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 14 Dec 2010, 11:58 PM
  3. Need help with my add cart. it is every where
    By sunshinepro in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Aug 2010, 01:18 AM
  4. Adding tracking code for analytics To Every Page?
    By fabienne in forum Basic Configuration
    Replies: 4
    Last Post: 14 Jul 2010, 08:02 PM
  5. Applying a Javascript code on every page?
    By skyegospel in forum General Questions
    Replies: 2
    Last Post: 19 Nov 2008, 02:29 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR