Datafeedr Support Forums

Datafeedr Support Forums (/index.php)
-   Questions (/forumdisplay.php?f=67)
-   -   one custom view for many categories? (/showthread.php?t=4959)

charlesk August 7th, 2011 09:04 PM

one custom view for many categories?
 
Hi

in my store's (id 31091) I have created a custom "category page" view called "casual" which I would like to use in all subcategories called "casual" (there are 13 of them) - how can I do that without having to create 13 custom views individually for every "casual" subcategory?

Kind regards
Charles

stefan August 8th, 2011 08:25 AM

I'm afraid there's currently no way.

Perhaps it might be better in this case not to make specific views, but rather add stuff specific to your "Casual" category to the default view using a conditional statement like this:

Code:

<?php if($category->name == "Casual") { ?>
.....insert specific stuff here
<?php } ?>


charlesk August 9th, 2011 09:42 AM

do you think that I could use this conditional statement to remove the "categories" module from the view?
I'll look in to that. Thanks!

parkerproject August 9th, 2011 10:28 AM

can i use the above method for assigning different page title and meta tags but putting that in the head porttion of the page.
Something like this;

<?php if($category->name == "Casual") { ?>
.....insert specific title and meta tags
<?php } ?>

stefan August 9th, 2011 12:51 PM

Quote:

Originally Posted by parkerproject (Post 22801)
can i use the above method for assigning different page title and meta tags but putting that in the head porttion of the page.
Something like this;

<?php if($category->name == "Casual") { ?>
.....insert specific title and meta tags
<?php } ?>

Yes, that should work imo.

charlesk August 11th, 2011 08:24 AM

Sorry for lame question - how do I add multiple category names to the <?php if... code?

Eric August 11th, 2011 08:51 AM

Quote:

Originally Posted by charlesk (Post 22840)
Sorry for lame question - how do I add multiple category names to the <?php if... code?

PHP Code:

<?php if($category->name == "Casual") { ?>
.....insert specific title and meta tags
<?php } elseif($category->name == "Another") { ?>
.....insert other category here specific title and meta tags
<?php } elseif($category->name == "More") { ?>
.....insert more category here specific title and meta tags
<?php ?>


Eric August 11th, 2011 08:52 AM

http://www.tizag.com/phpT/if.php


All times are GMT -5. The time now is 01:19 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.