Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Overriding breadcrumb & filenames.php

Overriding breadcrumb & filenames.php

Locked

Views: 3,191

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
6 Oct 2006, 11:22 PM
#1
akoza avatar

akoza

New Zenner

Join Date:
Sep 2006
Posts:
28
Plugin Contributions:
0

Overriding breadcrumb & filenames.php

I am creating a custom template and need to modify includes/application_top.php and includes/filenames.php files for additional entries.

Is there an override option available for these files or are these one of the few files that does not have the ability to override?

6 Oct 2006, 11:34 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Overriding breadcrumb & filenames.php

Why exactly do you feel you need to override these?

Almost all of the application_top bootstrap is handled via the init_includes folder contents, for where there is override support.

As for adding additional filenames definitions, it's best just to place a new file in the /includes/extra_datafiles folder containing JUST the new filename defines needed for your project. These files are auto-loaded during the initialization phases.

6 Oct 2006, 11:37 PM
#3
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: Overriding breadcrumb & filenames.php

These files cannot be overridden.

You can however create a php file (your_name.php) which would include the defines for your filenames and place this file in:

includes -> extra_datafiles

I think you can do the same thing for the application_top.php

create your_own_file.php and place this file in:

includes -> extra_cart_actions

6 Oct 2006, 11:54 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Overriding breadcrumb & filenames.php

Almost.

extra_cart_actions has a specific purpose, related to processing actions related to products "in" or being "added to"/"removed from" the shopping cart.

The "best" resolution really depends on the "why" and "what" behind the stated desire to override application_top.

7 Oct 2006, 2:53 AM
#5
akoza avatar

akoza

New Zenner

Join Date:
Sep 2006
Posts:
28
Plugin Contributions:
0

Re: Overriding breadcrumb & filenames.php

DrByte:

Why exactly do you feel you need to override these?

Almost all of the application_top bootstrap is handled via the init_includes folder contents, for where there is override support.

As for adding additional filenames definitions, it's best just to place a new file in the /includes/extra_datafiles folder containing JUST the new filename defines needed for your project. These files are auto-loaded during the initialization phases.

I didn't need to override the filenames.php but rather needed to add additional filename defines, which you provided the answer to. Thank you for that.

I want to edit the application_top.php file to remove the Home breadcrumb from appearing on the main index page. I am assuming it is there since I am used to osC but am most likely wrong on that assumption.

7 Oct 2006, 2:56 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Overriding breadcrumb & filenames.php

To add additional filenames there is a directory for:
/includes/extra_datafiles

Create a php file such as myfilenames.php and add it there ...

This way, it never gets overwritten during an upgrade and will load as if part of the original file:
/includes/filenames.php

7 Oct 2006, 2:57 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Overriding breadcrumb & filenames.php

/me polishes her glasses ...

Read screen ... re-read screen ... walk away and re-read screen for already answered question ... :lamo:

7 Oct 2006, 3:11 AM
#8
akoza avatar

akoza

New Zenner

Join Date:
Sep 2006
Posts:
28
Plugin Contributions:
0

Re: Overriding breadcrumb & filenames.php

Thank you for the follow-up Ajeh. :smile:

Any idea on removing the Home leading breadcrumb entry when on the main index page?

7 Oct 2006, 3:12 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Overriding breadcrumb & filenames.php

Akoza:

I want to edit the application_top.php file to remove the Home breadcrumb from appearing on the main index page. I am assuming it is there since I am used to osC but am most likely wrong on that assumption.

In v1.3.5 and onward, there's a really easy way to do this:

/includes/templates/YOURTEMPLATE/common/tpl_main_page.php
approx line 94:```

<!-- bof breadcrumb --> <?php if (DEFINE_BREADCRUMB_STATUS == '1') { ?>
<div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
<?php } ?> <!-- eof breadcrumb -->
simply add a check for $this_is_home_page  like this:```
<!-- bof  breadcrumb -->
<?php if (DEFINE_BREADCRUMB_STATUS == '1' && !$this_is_home_page) { ?>
    <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
<?php } ?>
<!-- eof breadcrumb -->
7 Oct 2006, 3:18 AM
#10
akoza avatar

akoza

New Zenner

Join Date:
Sep 2006
Posts:
28
Plugin Contributions:
0

Re: Overriding breadcrumb & filenames.php

Absolutely perfect! :D

Thank you so much.

8 Mar 2007, 6:49 AM
#11
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,771
Plugin Contributions:
9

Re: Overriding breadcrumb & filenames.php

AND...
In 1.3.7, turn it off in the Admin>Layout Settings>Define Breadcrumb Status.

2 will turn it off on the home page only.