• 0

Page template not applying to Category page


Question

Posted · Report post

Hi There,

 

I am working on a website and the client has requested specific category pages i.e One for General News and one for a specific topic. Thats all fine...  I have the categories linked to the top menu and all works great. 

 

I have then made separate templates for each category page, when i save and load the template all is fine but when i check back to the category after navigating away only one template seems to be applying to both category pages. 

 

Does that make sense? I wonder is this normal i.e. is there any issue with assigning page templates to individual category pages? 

 

Any help would be appreciated. 

 

Cheers,

 

Sean

Share this post


Link to post
Share on other sites

10 answers to this question

  • 0

Posted · Report post

I've having the same issue on my site: www.psychloop.com

 

Here is my setup: Pagelines DMS 1.1.6 with DMS Professional Tools 1.5. I have The Events Calendar Pro plugin populated with multiple events and event categories. I’ve created individual pages based on categories, so it will only show the events for each category in the Content/PostLoop section. Everything looks great except when I try to customize one page, several others change as well. I can’t even assign different templates to the pages. Other pages not based on categories work just fine.

 

For Example: Currently

 

Template                      A                     A                     B                      B

Page (category)            Networking      Workshops      Conferences     Classes

Sections                       QuickSlider      QuickSlider      iBox                 iBox

Content/PostLoop        Networking      Workshops      Conferences     Classes

 

The Problems:

If I change template of Networking to C, the template of Workshops also changes to C.

If I add a Hero section to Conferences, it adds a Hero Section to Classes.

 

What I want is something like:

 

Template                      A                     B                      C                     D

Page (category)            Networking      Workshops      ConferencesClasses

Sections                       QuickSlider      iBox                 Hero                iBox

Content/PostLoop        Networking      Workshops      Conferences     Classes

 

 

Help! This is a major hang-up for my site design. How can I fix this? Or better yet what can I tell my freelance web developer to do to fix it?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi there, special pages like categories, archive, search, all use the same template setup unfortunately. As they're dynamically generated pages they work as a group, so all category pages will use the same category template.

 

There's currently no way to change a template for a single category page without it affecting all category pages as these are dynamically generated pages.

 

This has been logged as a feature request for future editions, ref - http://forum.pagelines.com/topic/32889-different-post-template-for-different-category/

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi, I got a solution to create theme/template for post in different category.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

The file you need to edit: \dms\editor\editor.page.php

 

locate 

function type(){

		if( is_404() )
			$type = '404_page';

		elseif( pl_is_cpt('archive') )
			$type = get_post_type_plural();

		elseif( is_tag() )
			$type = 'tag';

		elseif( is_search() )
			$type = 'search';

		elseif( is_category() )
			$type = 'category';

		elseif( is_author() )
			$type = 'author';

		elseif( is_archive() )
			$type = 'archive';

		elseif( is_home() )
			$type = 'blog';

		// ID is now set...
		elseif( pl_is_cpt() )
			$type = get_post_type();

		elseif( is_page() )
			$type = 'page';

FOr example, I have a category named "news" (the cat id is 1) and another category named "kitchen" ( the cat id is 2)

 

Add below code to the above

elseif( is_category(‘kitchen’)) 
$type = 'kitchen';

The trick is that pageline dms deal with post tag page and etc as differet type. The DMS save and load template based on "TYPE", So you need to create your own TYPE. 

 

To make different "Type" for your different category, and place different section / content loop, anything else on the different "type" page will let you have different template.

 

Forgive my bad English..

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi, please see the attached screenshot. 

 

Different section + postloop section on different pages 

 

 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Please be aware that any edits you make to core files get wiped when you udpate the theme.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for the information everyone. I'll give it a shot. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks for the information everyone. I'll give it a shot. 

 

please have a look at the source of your page

 

located "pagetypeid"

 

here is what i test:  pageline dms assing differenct sections and layouts based on PagetypeID

 

so you need to ask your developer to find out a way to create extra PagetypeID for custom post type (events) categorys

 

based on your events category, you will have different "pagetypeID" and then you can assign different sections on it.

 

 

 

, nonce: '6819f5a6a4'   , pageTemplate: 'custom'   , templateMode: 'local'   , pageID: '70445871'   , typeID: '70445871'   , pageTypeID: 'tri_events_conference'   , pageTypeName: 'Tri Events Conference'   , devMode: false , CacheKey: 'ece549'   , isSpecial: '1'

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now