Jump to content

"Blocking" a category from displaying in categories.tpl


Guest Romulus Design

Recommended Posts

Guest Romulus Design

The site I'm building with ZenCart is run this way. In the navigation, there are categories, and then accessories. Obviously, accessories is a category itself, but I do not want it to be listed with the categories drop-down menu I built.

What I plan to do is implement an if-statement in categories.tpl

If catId=6, don't print anything. Otherwise, do what it normally does.

<?

...Existing Loop

if(catID != 6)

print(...) //Existing statement.

However, the code is kind of cryptic. What files would I need to edit for this? I don't think it would be the .tpl file itself, but the file that controls the categories.tpl file. I just have no idea which one that is!

Thanks for any and all help. It doesn't seem too hard, I just don't know where the control file is.

Link to comment
Share on other sites

Guest Romulus Design

Is it rude for me to bump my post? It's been like a week, and I got no answers...

I told my client the second best idea I have is to write a PHP script that does that categories.tpl does, except I can't tell which categories are still active. Like for example, their "core" category has CAT.ID of 5. They erased categories 1-4.

Also, another idea I just had, how will it get the CAT.NAME?

I really wish someone could just tell me how to implement PHP into these .tpl files.

Link to comment
Share on other sites

  • 4 weeks later...
Guest Wrk_InProgress

I am not 100% familiar with the templating system even though I have hacked it to bits.

It might make the most sense to just go find the included php file associated with the categories box and eliminate the catID from the SQL statement.

As it stands, Iwould think the SELECT statement pulls all the catIDs, so you have to add a WHERE clause.

Link to comment
Share on other sites

What files would I need to edit for this? I don't think it would be the .tpl file itself, but the file that controls the categories.tpl file. I just have no idea which one that is!

Thanks for any and all help. It doesn't seem too hard, I just don't know where the control file is.

The control file information for all templates can be found over in the CubeCartForums.org Documentation. Hope this helps.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...