Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Creating custom buttons linking to extra pages

Creating custom buttons linking to extra pages

Views: 2,623

Results 1 to 7 of 7
16 Aug 2022, 4:53 AM
#1
roodney avatar

roodney

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Creating custom buttons linking to extra pages

I have read about this version of Zencart using CSS buttons now (I am in the process of setting up a new version of our v1.54 site that badly needed an update). But it's not clear to me what the actual steps are. Lets say I want to add a couple of buttons to the front page that link to a Store Locator page and the About Us page. Is there documentation that would walk me through that or am I better off using a template that offers buttons?

16 Aug 2022, 4:20 PM
#3
roodney avatar

roodney

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Creating custom buttons linking to extra pages

Thank you for the links, if I look at the information sidebox template it has much less content than for example the tpl_index_default.php file (since I want the links on the main page I assume this would be the file to add it to). Would the link, in this case the documentation example ```php
$content .= '<li><a href="' . zen_href_link(FILENAME_EZPAGES,'id=9') . '">' . "My new page" . '</a></li>';

16 Aug 2022, 11:50 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,695
Plugin Contributions:
56

Re: Creating custom buttons linking to extra pages

The placement is your call. Put them where ever you like.
If you only want them on the main page, you might consider using the main page define page for the buttons, but remember that it's HTML only and not PHP.

17 Aug 2022, 1:04 AM
#5
roodney avatar

roodney

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Creating custom buttons linking to extra pages

So I would insert it more like this;

<a href="' . zen_href_link(FILENAME_EZPAGES,'id=9') . '">' . "Store Locator" . '</a>

And is there a section in the docs on the CSS buttons being added in an HTML page?

17 Aug 2022, 5:13 AM
#6
roodney avatar

roodney

New Zenner

Join Date:
Jul 2011
Posts:
27
Plugin Contributions:
0

Re: Creating custom buttons linking to extra pages

Ok so I did get the button to show up using this in the define pages editor (main page);

<button class="button" onclick="location.href='index.php?main_page=index&cPath=1';">About Us</button>

Now I just have to adjust the CSS style to suit my needs.

17 Aug 2022, 7:26 AM
#7
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,695
Plugin Contributions:
56

Re: Creating custom buttons linking to extra pages

Great! Hope the upgrade goes well and gets deployed soon.