Zen Cart Logo
Forums / All Other Contributions/Addons / Define Pages Generator addon - Support

Define Pages Generator addon - Support

Views: 29,960

Results 21 to 40 of 137
20 Dec 2007, 8:32 PM
#21
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Define Pages Generator addon - Support

I just realized that maybe I'm not being clear about this. I know that the filenames will be different depending on what name you select when you first use the program. I guess what I really need is the path to the filename ie:

includes/extra_datafiles/my_filename.php

or something like that. Is that making more sense now? Hope so. As always thanks for any help.

20 Dec 2007, 9:32 PM
#22
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: Define Pages Generator addon - Support

The (basic) rule is that if your file name is "bAdLy-nameD page" then you capitalise it: "BADLY-NAMED PAGE" and replace non-alphanumeric characters with "_": "BADLY_NAMED_PAGE", then prefix it with the word "FILENAME": "FILENAME_BADLY_NAMED_PAGE"

The next version which i am just putting the finishing tuoches to makes this clear.

The basic trick when dealing with any php website is if you want to edit a bit of generated code:

  1. find the id of the closest tag with an id to the bit of code that you want to edit.
  2. Search through the entire source code for this string (most text editors and dreamweaver can do this) hopefully the place you find this string will be near to the code you want to modify.

In your case try searching for "navMain" ;)

21 Dec 2007, 12:14 AM
#23
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

banswidthjunkie:

The (basic) rule is that if your file name is "bAdLy-nameD page" then you capitalise it: "BADLY-NAMED PAGE" and replace non-alphanumeric characters with "_": "BADLY_NAMED_PAGE", then prefix it with the word "FILENAME": "FILENAME_BADLY_NAMED_PAGE"

The next version which i am just putting the finishing tuoches to makes this clear.

The basic trick when dealing with any php website is if you want to edit a bit of generated code:

  1. find the id of the closest tag with an id to the bit of code that you want to edit.
  2. Search through the entire source code for this string (most text editors and dreamweaver can do this) hopefully the place you find this string will be near to the code you want to modify.

In your case try searching for "navMain" ;)

I'm getting closer to understanding this :wacko: I was able to find the filename with the navMain ID in it. There is some logic there to check and see if the person is logged in or not and what to put on the nav page for either condition.

That leaves me with just one more file to find and edit. What is the path to the filename where I put this in?
$link_to_my_page = zen_href_link( FILENAME_MY_PAGE, '' );

If I know that, I think I can get everything to work. Thanks again for your patience with me on this.

21 Dec 2007, 12:35 AM
#24
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: Define Pages Generator addon - Support

basically that depends where you want the link to go exactly, if you want it in the bar at the top of the page, then you probably want to put it in the file you found, if not it might be another file.

You sort of have to follow your nose with this stuff.

21 Dec 2007, 1:59 AM
#25
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

banswidthjunkie:

basically that depends where you want the link to go exactly, if you want it in the bar at the top of the page, then you probably want to put it in the file you found, if not it might be another file.

You sort of have to follow your nose with this stuff.

Sorry bwj... I'm just not getting it lol... guess I will wait until you come out with the new version and see if I can understand that one better. I don't want to wear out my welcome where your help is concerned. Thanks a bunch for your help. I DO appreciate it. Maybe after the new version comes out I can bug you some more j/k... Thanks and have a great holiday season!!!

21 Dec 2007, 2:05 AM
#26
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

crabdance, a "page" of ZC contains many files in many folders:

  • The language file in language folder usually define header, title, etc.
  • The modules/pages/header_php.php contains all the functions or any code needed to be run before loading the template.
  • and the template file.

Basically, when you want to create a page in zencart, which you can access using the link index.php?main_page=page_name, you have to create all those files. This mod simply helps you to create that set of file much faster, and that's it. Even with the new version of this mod or not, this is how things are done on ZC, not because the author of the mod wants to make it that way.

21 Dec 2007, 2:19 AM
#27
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

yellow1912:

crabdance, a "page" of ZC contains many files in many folders:

  • The language file in language folder usually define header, title, etc.
  • The modules/pages/header_php.php contains all the functions or any code needed to be run before loading the template.
  • and the template file.

Basically, when you want to create a page in zencart, which you can access using the link index.php?main_page=page_name, you have to create all those files. This mod simply helps you to create that set of file much faster, and that's it. Even with the new version of this mod or not, this is how things are done on ZC, not because the author of the mod wants to make it that way.

Thanks for letting me know all of this, Yellow. I'm still learning how ZC is put together and what you have just said helps me a lot. I hope that I haven't sounded like I was getting down on the author of the mod. I certainly don't want to do that. I'm just trying to wrap my head around how all this works. BWJ has done a great job with the mod and I don't want to take anything away from him for sure.

The only reason I was "giving up" was that I thought I was making an *ss out of myself for asking so many questions. I thought that maybe I was making too much of this and not getting it straight. I appreciate your help and BWJ's help. You have both helped me to understand some things that would have taken me a while to get.

A big thank you to both of you... you both have been great trying to help me out! I will take the information that you gave me and see if I can try to get it working again.

21 Dec 2007, 2:26 AM
#28
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: Define Pages Generator addon - Support

I suppose it it sort of like speaking japanese: if you speak it, it is the most natural thing in the world, if not it sounds like someone repeatedlay saying "desu" very quickly.

There is not much either Yellow or I can say to solve this, it is just a matter of hitting your head against a brick wall until nihongo wo hanashimasu (you can speak japanese). I find drinking lots of Stella helps :)

21 Dec 2007, 2:26 AM
#29
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

You are welcome. It took me a while to get a hold of ZC as well.

BTW, I made a typo in the post above, should be:
includes/modules/pages/page_name/header_php.php

21 Dec 2007, 2:34 AM
#30
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: Define Pages Generator addon - Support

@crabdance <- don't feel like you are being an *ss for asking questions, none of my friends can program and when I try to explain it to them they don't understand. I wouldn't even like to think about how long I have spent learning programing languages. I spent a solid year learning virtually every nuance of C++ on government money and since then I can pick up a new language pretty quickly (although I still get very frustrated with CSS). Programing is hard, my philosphy is that anyone who is willing to give it a go deserves a little patience.

21 Dec 2007, 2:56 AM
#31
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

banswidthjunkie:

@crabdance <- don't feel like you are being an *ss for asking questions, none of my friends can program and when I try to explain it to them they don't understand. I wouldn't even like to think about how long I have spent learning programing languages. I spent a solid year learning virtually every nuance of C++ on government money and since then I can pick up a new language pretty quickly (although I still get very frustrated with CSS). Programing is hard, my philosphy is that anyone who is willing to give it a go deserves a little patience.

Hi Banswidthjunkie... thanks for making me feel better about the many questions. I understand about how much time you can put into learning programming languages. I have certainly spent a lot of time myself. I don't do it much anymore (by choice lol). Once I understand ZC (or at least enough of it), I hope that I can make contributions too.

If you don't mind... let me try at asking my question again. I understand that I can put: echo '<a href="' . $link_to_my_page . '">Link Text</a>'; in the
includes/templates/template_default/common/tpl_header.php file in the navMain ID section.

Now I just need to know where I should put:
$link_to_my_page = zen_href_link( FILENAME_MY_PAGE, '' );
There must be a standard place where you put this. If you were going to put a link in the nav bar to your page, where would you put this code?

Once again... thanks for the patience and kindness.

21 Dec 2007, 3:10 AM
#32
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

Oh... I love CSS. Almost all of my site was done with the CSS stylesheet. I still don't understand it really well but I think that it is cool how it works. Here's wishing you better times with the CSS files! :yes:

21 Dec 2007, 3:15 AM
#33
banswidthjunkie avatar

banswidthjunkie

Zen Follower

Join Date:
Nov 2007
Posts:
167
Plugin Contributions:
1

Re: Define Pages Generator addon - Support

personally, I would put
$link_to_my_page = zen_href_link( FILENAME_MY_PAGE, '' );
on the line above the line where i wrote
echo '<a href="' . $link_to_my_page . '">Link Text</a>';

You should think of php as a printer. Unlike C++, php is a lazyboy easy language. If you step even an inch out of line with C++ it puts you in your place and lets you know who's boss. But php lets you do what you want.

"echo" means print, everything other than echo is stuff you need to do to print.

By the way don't bother watchong Flock with Richard Gere, it's rubbish.

21 Dec 2007, 3:22 AM
#34
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

Or, why not just:
echo '<a href="' . zen_href_link( FILENAME_MY_PAGE, '' ) . '">Link Text</a>';

21 Dec 2007, 3:32 AM
#35
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

Ok... I'm trying to get the one liner to work. Give me a bit to play around with it and I will either ask more questions or let you know how things are going.

21 Dec 2007, 3:56 AM
#36
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

Ok... I have got it to work some. I have created a "4Fun" link in the nav bar and it takes me to "some" page but I'm not sure if it's the right one. Here is what the url window shows in FF: http://tranquillas.com/biz/index.php?main_page=4fun
I went into the "define pages editor" and changed the color of the sample text to red (my background is black)... but the sample text does not appear to show up.

Would either of you mind taking a look at my site and see what I'm talking about. Hey... I'm just tickled that I got something to show up on the nav bar <grin>

thanks for the help.

21 Dec 2007, 4:20 AM
#37
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

I just noticed that my nav bar title is not working. Who do need to shoot in order to get that working lol...

I will be checking out the code(s) until I hear from either of you.

tanks

21 Dec 2007, 4:23 AM
#38
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

Seem like some files are not placed in the correct folder.
Make sure you input the correct name of your template when you create new "page".

21 Dec 2007, 4:34 AM
#39
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

yellow1912:

Seem like some files are not placed in the correct folder.
Make sure you input the correct name of your template when you create new "page".

The files MUST be in the right order because I just did a drag and drop in FileZilla. The correct name for the template is 4fun. Here's where my code is (if that helps).

<div id="navMain"> <ul class="back"> <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> <?php if ($_SESSION['customer_id']) { ?> <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li> **<?php echo '<a href="' . zen_href_link( FILENAME_4FUN, '' ) . '">4Fun</a>'; ?>** <?php } else { if (STORE_STATUS == '0') { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php echo '<a href="' . zen_href_link( FILENAME_4FUN, '' ) . '">4Fun</a>'; ?>
<?php } } ?> <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?> </ul> </div>

Hope this helps. At least I made a little ground (smile).

21 Dec 2007, 5:14 AM
#40
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Define Pages Generator addon - Support

Just to let you know... I re-installed the files so that I was SURE that they were going into the right place. Behavior of the web page stays the same....