Forums / General Questions / Proper way to link within my store

Proper way to link within my store

Locked

Views: 1,365

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
3 Jan 2008, 9:43 PM
#1
shadoh avatar

shadoh

New Zenner

Join Date:
Dec 2007
Posts:
39
Plugin Contributions:
0

Proper way to link within my store

So I (accidentally) discovered that I can link within different defined pages by using code like:

<a href="<?php echo zen_href_link(FILENAME_CONTACT_US); ?>">Contact Us</a>

and just replacing CONTACT_US with like CONDITIONS or PAGE_2 or PAGE_3 or whatever. But, this doesn't seem to work outside of these set of defined pages. Is there a proper way to link within my site?

For example, let's say within one of my product descriptions, I'd like to have a link that says "Tell me about this" which links to PAGE_2. Right now, I'm having to use a hard-coded link, like:

<a href="http://mysite.com/zencart/index.php?main_page=page_2">Tell me about this</a>

But I'm sure there has to be a better / more correct way of doing this. I tried using the php echo command, which works within all the define_xxx pages, but not outside of there (such as inside product descriptions).

3 Jan 2008, 10:14 PM
#2
veronika7747 avatar

veronika7747

Zen Follower

Join Date:
Nov 2007
Posts:
270
Plugin Contributions:
0

Re: Proper way to link within my store

shadoh:

So I (accidentally) discovered that I can link within different defined pages by using code like:

<a href="<?php echo zen_href_link(FILENAME_CONTACT_US); ?>">Contact Us</a>

> 
> and just replacing CONTACT_US with like CONDITIONS or PAGE_2 or PAGE_3 or whatever.  But, this doesn't seem to work outside of these set of defined pages.  Is there a proper way to link within my site?
> 
> For example, let's say within one of my product descriptions, I'd like to have a link that says "Tell me about this" which links to PAGE_2.  Right now, I'm having to use a hard-coded link, like:
> 
> ```
<a href="http://mysite.com/zencart/index.php?main_page=page_2">Tell me about this</a>

But I'm sure there has to be a better / more correct way of doing this. I tried using the php echo command, which works within all the define_xxx pages, but not outside of there (such as inside product descriptions).

why don't you just use:

<a href="index.php?main_page=page_2">What Ever </a>

for other pages it would look like this:

<a href="index.php?main_page=product_info&cPath=4&products_id=30">Name Of Your Link</a>

If you need to find the correct address, just bring that page into your browser and copy the necessary part.

Hope this helps

9 Jan 2008, 1:31 AM
#3
spheric avatar

spheric

New Zenner

Join Date:
Jan 2008
Location:
desert
Posts:
41
Plugin Contributions:
0

Re: Proper way to link within my store

[QUOTE=Veronika7747;483596]why don't you just use:

<a href="index.php?main_page=page_2">What Ever </a>

Because you will notice that with cookies turned off in the browser, the session will break once this link is clicked. The OP's original code,

<a href="<?php echo zen_href_link(FILENAME_CONTACT_US); ?>">Contact Us</a>

should pass the session id in the url when cookies are turned off in most cases. i'm exploring other ways of doing this as well. cheers!

Regards from www.dataSpheric.com.