Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    help question Insert an EZPage into Product Descriptions or other Pages

    Greetings,

    I'm working on a new site that uses common statements for some of the product descriptions (Ex. This product is Certified Organic). This statement is in addition to the specific description of each product.

    I would like to create the ability to insert an EZpage (that has the common statement) into products descriptions. This way, if one needs to change the common statement, it is done on the EZpage, not ALL of the products descriptions!

    Also, if I'm going to do this, I might as well have the ability to add an EZpage to any of the define pages or even other EZpages (except for the EZpage that is inserting it's self). I think this may make a good Plugin too!

    Here's my thinking, I would use a template style placeholder that has the EZPage IDs as it's value.

    Example:

    1. Here is a product description an I want to insert a few EZpages here {{12, 24, 2}} and maybe one here {{3}} as well!

    Or if easier to code

    2. Here is a product description an I want to insert a few EZpages here {{12}}{{24}}{{2}} and maybe one here {{3}} as well!

    I have the logic flow sort of figured, but not the PHP skills to code without help! My thinking is to break apart the description into an array at the placeholders and store the placeholders in a 2D array (to support multi ID's per placeholder). Then, loop through the placeholders 2D array, striping out the IDs and make the EZpage calls, concatenate the results into a new 1D array. This would now leave you with two 1D arrays that can now be re-assembled.

    My initial hurtle is how one would go about breaking apart the description into the two arrays, product description parts and placeholders with the IDs of the EZpages? If one could think of a better approach, I'm open!
    Experience is what you get when you don’t get what you want…

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    I think if you check out swguy's website and look for boilerplate code or elsewhere in the forum, it does/offers the ability to do exactly what you are trying to accomplish... There certainly are other ways as well with adding other "programmable" options to put content on all pages that could then be CSS controlled (not exactly advised as the CSS would send the information to everyone to include a "hide" statement where not desired to be shown and increase bandwidth usage). Other methods could be used also to "track" which items should have which display information and PHP or PHP/MySQL could sort it out.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    Quote Originally Posted by mc12345678 View Post
    I think if you check out swguy's website and look for boilerplate code or elsewhere in the forum, it does/offers the ability to do exactly what you are trying to accomplish... There certainly are other ways as well with adding other "programmable" options to put content on all pages that could then be CSS controlled (not exactly advised as the CSS would send the information to everyone to include a "hide" statement where not desired to be shown and increase bandwidth usage). Other methods could be used also to "track" which items should have which display information and PHP or PHP/MySQL could sort it out.
    Thanks mc12345678,

    Couldn't find any place on swguy's website that has boilerplate code...already searched through the ZC forums before I posted, but doesn't mean I didn't miss something! ...would be great if you could point me to a ZC forum page to get me going!
    Experience is what you get when you don’t get what you want…

  4. #4
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    Quote Originally Posted by kwright View Post
    Thanks mc12345678,

    Couldn't find any place on swguy's website that has boilerplate code...already searched through the ZC forums before I posted, but doesn't mean I didn't miss something! ...would be great if you could point me to a ZC forum page to get me going!
    Sometimes the best information is found by searching from outside the forum on items in the forum...

    https://www.zen-cart.com/showthread....om-description

    Is at least a thread that leads to the code and discusses it a little... I believe there are others in the forum. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    Quote Originally Posted by mc12345678 View Post
    Sometimes the best information is found by searching from outside the forum on items in the forum...

    https://www.zen-cart.com/showthread....om-description

    Is at least a thread that leads to the code and discusses it a little... I believe there are others in the forum. :)
    Excellent! I'll read through the thread and look at the boilerplate code! I hope it will allow one to insert boilerplate text in the middle of the description and not just before or after...

    I did go back to That Software Guy's site and found the boilerplate code you first had mentioned under Tips and Tricks.

    Thanks again mc12345678
    Experience is what you get when you don’t get what you want…

  6. #6
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    Quote Originally Posted by kwright View Post
    Excellent! I'll read through the thread and look at the boilerplate code! I hope it will allow one to insert boilerplate text in the middle of the description and not just before or after...

    I did go back to That Software Guy's site and found the boilerplate code you first had mentioned under Tips and Tricks.

    Thanks again mc12345678
    From looking at the code and explanation of how to use (sometime in the last couple of years) yes it can be applied throughout... In fact that's why it was developed because the desre was to implement something within the description area. There are some strategies that need to be appled, but should serve the desired process..
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    Quote Originally Posted by mc12345678 View Post
    From looking at the code and explanation of how to use (sometime in the last couple of years) yes it can be applied throughout... In fact that's why it was developed because the desre was to implement something within the description area. There are some strategies that need to be appled, but should serve the desired process..
    Just had a good look-through of the code and forum thread. The boilerplate mod seems to be close enough to get me going!

    Thanks
    Last edited by kwright; 25 Sep 2015 at 02:29 AM. Reason: Found Answer
    Experience is what you get when you don’t get what you want…

  8. #8
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    Quote Originally Posted by kwright View Post
    Just had a good look-through of the code and forum thread. The boilerplate mod seems to be close enough to get me going!

    Thanks
    Was going to say, the first post of the above link referenced the basic instructions on how to use it. Essentially it is a search and replace of content in the description substituting whatever is referenced... The referenced information is up to your imagination, but it offers a way to consistently provide the content that can be "easily" changed as necessary and consistently... If that content is to end up being whatever is in an ez-page, then so be it. It's a way to make it happen. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    Quote Originally Posted by mc12345678 View Post
    Was going to say, the first post of the above link referenced the basic instructions on how to use it. Essentially it is a search and replace of content in the description substituting whatever is referenced... The referenced information is up to your imagination, but it offers a way to consistently provide the content that can be "easily" changed as necessary and consistently... If that content is to end up being whatever is in an ez-page, then so be it. It's a way to make it happen. :)
    Yes, now for what I would like to do is a bit more complicated since the code will not know what the reference (CONSTANT) will be until it is pulled out of the description and analyzed. The goal is to have a system where one can add any EZpage or pages to any description or other page from the Admin.

    I believe I can use most of the boilerplate code. If I can use a variable rather than a constant as the reference in the description, then I could add a step that pulls the reference (ex. {{24}}), strip the {{}}, then make a call to EZpage table with ID=24, then replace the {{24}} in the description with the variable $ezp_24 and set the variable, $ezp_24='content of EZpage'. Then go about the code as intended.

    Basically, replace the define with a variable on the fly in the description...

    What do you think?
    Experience is what you get when you don’t get what you want…

  10. #10
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Insert an EZPage into Product Descriptions or other Pages

    Quote Originally Posted by kwright View Post
    Yes, now for what I would like to do is a bit more complicated since the code will not know what the reference (CONSTANT) will be until it is pulled out of the description and analyzed. The goal is to have a system where one can add any EZpage or pages to any description or other page from the Admin.

    I believe I can use most of the boilerplate code. If I can use a variable rather than a constant as the reference in the description, then I could add a step that pulls the reference (ex. {{24}}), strip the {{}}, then make a call to EZpage table with ID=24, then replace the {{24}} in the description with the variable $ezp_24 and set the variable, $ezp_24='content of EZpage'. Then go about the code as intended.

    Basically, replace the define with a variable on the fly in the description...

    What do you think?
    So my thought is that there be some consistent information in the product description that is used to translate as necessary to give the final result... The code is such that whatever is provided can be "translated" to a desired final affect. If that is to take the number and apply it to a link for an EZ page, then that's what it will do. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Welcome Guest! - How do I insert this command into other parts of the template?
    By PearceStephens in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Nov 2012, 11:15 AM
  2. How to insert images into pages for Fual Slimbox?
    By luther in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 1 Mar 2010, 10:20 PM
  3. How do I insert a word document into an EZPage?
    By wiccan0974 in forum General Questions
    Replies: 5
    Last Post: 22 Jan 2009, 06:24 PM
  4. Using an <iframe> tag to insert the dropdown header menu into other pages...
    By rainthebat in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 27 Nov 2007, 06:20 PM
  5. EZ Pages - insert new page into Information Box
    By bigfatgreedykat in forum General Questions
    Replies: 0
    Last Post: 30 Oct 2006, 12:35 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