Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2005
    Location
    Waukee, Iowa
    Posts
    206
    Plugin Contributions
    0

    Default Contribution File Structure

    Greetings,

    I had to update the newsletter subscription/removal contributions for v1.3 and since I've done the work I thought I'd repackage the combined files to save others the work, but I had a question regarding the file structure.

    I'm trying to use template overrides where possible.

    If I have two files (say subscribe.php and unsubscribe.php), one new and one a modification, should I put the new files in both a template_default folder and YOUR_TEMPLATE/ folder, or should the new files be placed only in the template_default folder, and modifications in the YOUR_TEMPLATE folder?
    Or should I place everything I can in YOUR_TEMPLATE folders and not put anything in template_default folders?

    Clarification provided upon request, any help is appreciated.

    -Ng_

  2. #2
    Join Date
    Sep 2004
    Posts
    2,420
    Plugin Contributions
    2

    Default Re: Contribution File Structure

    Quote Originally Posted by NotGoddess
    If I have two files (say subscribe.php and unsubscribe.php), one new and one a modification, ... should I place everything I can in YOUR_TEMPLATE folders and not put anything in template_default folders?
    Yes... that is if you're referring to tpl_*.php files and /includes/templates/template_default/templates/

    then package your mod files so they go in /includes/templates/YOUR_TEMPLATE/templates/

    When modifying a core file please indicate in a readme the modifications required, including appx line numbers where code modficications occur (for specific version of Zen Cart) and include snippets of existing code where new code needs inserted and/or the existing code needing modified.

    Woody

  3. #3
    Join Date
    Sep 2004
    Posts
    2,420
    Plugin Contributions
    2

    Default Re: Contribution File Structure

    Quote Originally Posted by NotGoddess
    If I have two files (say subscribe.php and unsubscribe.php), one new and one a modification,
    Rereading, your post I see these two files are not template files. The new file would go into /includes/modules/ and the modified file to /includes/modules/YOUR_TEMPLATE/

    Same would apply to "pages".

    Or are you referring to language files?

    If you have a version of your mod running on a website please post a URL.

    Woody

  4. #4
    Join Date
    Jan 2005
    Location
    Waukee, Iowa
    Posts
    206
    Plugin Contributions
    0

    Default Re: Contribution File Structure

    Quote Originally Posted by Woodymon
    Yes... that is if you're referring to tpl_*.php files and /includes/templates/template_default/templates/
    I am referring to both template files (tpl), language files, and modules-I am using overrides where I can.

    From the snippet you posted I take it I should not put anything in template_default, even new/original files. That does make sense to me, since it would keep needed files together, but I've seen it all three ways in contribs.

    Quote Originally Posted by Woodymon
    When modifying a core file please indicate in a readme the modifications required, including appx line numbers where code modficications occur (for specific version of Zen Cart) and include snippets of existing code where new code needs inserted and/or the existing code needing modified.
    Already done-I have each change start/end clearly marked, and will be including both a manifest documenting changes and diff file for v1.3 integration.

    Thank you for your answer,

    -Ng_

  5. #5
    Join Date
    Sep 2004
    Posts
    2,420
    Plugin Contributions
    2

    Default Re: Contribution File Structure

    Quote Originally Posted by NotGoddess
    I am referring to both template files (tpl), language files, and modules-I am using overrides where I can.

    I take it I should not put anything in template_default, even new/original files. That does make sense to me, since it would keep needed files together, but I've seen it all three ways in contribs.
    Where you put the files (how you override them) depends on the type of file it is. "template" (tpl_*.php) files are different from other files.

    You don't want to put modified core template files in /includes/templates/template_default/templates/ as they will likely be overwritten by a future Zen Cart upgrade. (I only patch core template files in template_default when instructed by Zen Cart Devs). Instead place your modified template files in /includes/templates/YOUR_TEMPLATE/templates/

    Best if you reviewed the overrides documentation. See posts #4 in the following thread for some links and info. http://www.zen-cart.com/forum/showthread.php?t=35642

    Also this post may help. http://www.zen-cart.com/forum/showthread.php?t=35361

    And checkout the structure of mods from other developers to see how they packaged their distribution. Yes, I too have observed a few mods which were not packaged correctly and did not provide correct override instructions. But all the recenly released/updated mods I have come across have been fine in this regard.

    Your effort in packaging your mod with correct override instructions is much appreciated. Thanks and good luck.

    Woody

  6. #6
    Join Date
    Jan 2005
    Location
    Waukee, Iowa
    Posts
    206
    Plugin Contributions
    0

    Default Re: Contribution File Structure

    Thank you for your responses, Woody.

    The question was not one of 'how' but more 'if' - files that actually overwrite files would of course go in a separate override folder, but the disposition of new files (files added for this contribution) were the issue.

    I believe you've helped me find the correct approach and I thank you.

    The mod is not on a live site yet, as I need to do a full qa test on my development server prior to uploading and merging with the live cart.

    Thank you,

    -Ng_

  7. #7
    Join Date
    Sep 2004
    Posts
    2,420
    Plugin Contributions
    2

    Default Re: Contribution File Structure

    Quote Originally Posted by NotGoddess
    The question was not one of 'how' but more 'if' - files that actually overwrite files would of course go in a separate override folder, but the disposition of new files (files added for this contribution) were the issue.
    NG -

    The answer to the above is 'it depends', on the type of file it is. Template files will always go into MY_TEMPLATE, but as I previously posted if it is a 'new' module file then it should go into /includes/modules. Does it make sense now?

    Woody

  8. #8
    Join Date
    Jan 2005
    Location
    Waukee, Iowa
    Posts
    206
    Plugin Contributions
    0

    Default Re: Contribution File Structure

    It made sense the first time-apparently my posts make me appear more dense or incomprehensive than I am ;). No need to clarify further and I thank you for your help.

    -Ng_

 

 

Similar Threads

  1. Image file structure
    By freshstart in forum General Questions
    Replies: 4
    Last Post: 8 Jun 2008, 06:38 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