Jump to content

Archived

This topic is now archived and is closed to further replies.

seanocaside21

Page template not applying to Category page

Recommended Posts

seanocaside21+    10
seanocaside21

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
ollyoxnfree    1
ollyoxnfree

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
James B    436
James B

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/


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
asialove    6
asialove

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

Share this post


Link to post
Share on other sites
asialove    6
asialove

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
asialove    6
asialove

Hi, please see the attached screenshot. 

 

Different section + postloop section on different pages 

 

 

Share this post


Link to post
Share on other sites
asialove    6
asialove

asialove Thanks for that i actually came across this solution http://wphtml5.com/pageline-dms-how-to-create-different-template-for-different-category/

Was late last night... and have just got it working for me now. 

 

Hope this helps out others with the same issue. 

That is great,  I am sorry for my bad writings,,, wphtml5.com is my blog..:-)

Share this post


Link to post
Share on other sites
James B    436
James B

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


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
ollyoxnfree    1
ollyoxnfree

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

Share this post


Link to post
Share on other sites
asialove    6
asialove

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

  • Similar Content

    • JP
      By JP+
      Hello,
      We are working on a 2 languages site (https://liguecardioliga.be) with wpml, and lately the call of a category in the loops section (and all the sections requiring a category to select posts) doesn't work in the translated language. It worked well until recently so I wonder if it's because of a recent update (wordpress, wpml, pagelines, a plugin?). Anyone has the same problem? a solution?
      TIA
    • mzhafzah
      By mzhafzah
      Hello
      I am using DMS 2 theme and I want to create a 2 different links on my website; each link should take you to a different blog post category. Although the process is easy, yet I can not figure out how to give each category page a unique design of its own; Any change I make on any page is applied to the other (I'm aware of the universal elements like the header and footer and I a am not talking about these.)
      Since I am new to wordpress in general, I am not sure if my description is sufficient; apologies if it is not.
      TycoonJé
    • morrisjohnc
      By morrisjohnc
      Hello,
       
      My blog has two separate types of post content, both of which need to be created as posts, not pages, in WP.
       
      On the category pages, Bespoke pulls the featured image and the 10 word excerpt (or whatever is provided for in the excerpts post field).  How can I get certain categories to show the full content of a post and others this standard format with the "read more" button?
       
      Question 2 - Is it possible to have different templates for different category listing pages?  Example, use the postloop for one category and the masonic gallery for another?
       
      Thank you in advance for your help!
    • aldisney
      By aldisney+
      Hi--
      I was wondering if there was a relatively easy to way automatically assign a thumbnail to a post category when displaying posts in the Masonic Gallery format, when the post doesn't have a featured image? I've got a client with a ton of posts that just won't have any featured images, but each category has a header image. I'd like to display the header image as the thumbnail for all these posts, since, going forward, my client does actually plan to use featured images.
       
      Thanks!
    • Claude203
      By Claude203
      Hi, the Modal Popup is working fine. But whenever I look on the DMS Editor, that section is gone. It was placed at the bottom of the Footer. The first time it happened, I thought maybe I had inadvertently deleted it, or not saved properly. So I re-created another one. And so on. Then I finally realized it was working after all. But now I'm wondering if there are several of my popups in place, all of them the same, yet none of them visible, but yet all of them working. I've tried adjusting/saving into a new page template. I've tried turning on/off the DMS Editor. Still can't find a trace of the Modal Popup section, yet I know it works because I used Safari and Firefox to confirm, even on a different computer. Thanks for any help/insight you might provide.
       
      http://www.blackfives.org
×