Jump to content


Photo
- - - - -

Sections: Workswith and Failswith?


Best Answer James B , 28 February 2013 - 02:21 AM

Ok I've read that through a couple of times and I hope I'm understanding it.

 

The only way I think you might be able to do this is to use css to hide the sections you don't want on one template, based on the page class/id and visa versa to display for the other template. Using css to mimic the hiding 'sections' tab we have in the meta settings (but on a more specific basis).

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 idea15

idea15

    Advanced Member

  • Members
  • 58 posts
  • Country: Country Flag

Posted 27 February 2013 - 11:57 AM

Is there a full list of all the possible options for workswith and failswith within your own custom sections?

 

Here's my probem: I have a custom taxonomy (magazine) with many categories (magazine by issue) and many tags (story contributor). I have created custom sections for Issue Summary and Story Contributor. The idea is that Issue Summary would appear at the top of the archive page showing all of the articles in any particular issue. Story Contributor would appear at the top of the archive page showing all of the stories written across all issues by any particular writer. (NB these are not authors in the WordPress account sense, which is why we have done custom taxonomies.)

 

I have successfully created the sections but because they both are pulled from the custom taxonomy "magazine", magazine_archive, they both appear on all archive pages. So, for example, if you look at an issue archive, the Issue Summary box is at the top as it should be, but below that is the Story Contributor box of the most recent story author, which I don't want. Likewise, if you pull up a Story Contributor archive, the Issue Summary box for the latest issue appears at the top, followed by the correct Story Contributor box.

 

I've experimented with "Workswith" and "Failswith" in tag, tags, contributor, tax-contributor, magazine_archive, archive, category, etc with no luck.

 

The body class for an issue archive page is

<body class="archive category category-54-winter-2011-2012 category-30 logged-in admin-bar custom content-shadow responsive pagelines magazine_archive full_width customize-support">

 

The body class for a story contributor archive page is

<body class="archive tax-contributors term-joe-socks term-12 logged-in admin-bar custom content-shadow responsive pagelines magazine_archive full_width customize-support">



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 16342 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 27 February 2013 - 12:45 PM

Hi,

 

I have just this moment made an edit to the Post Author section, which only works on the Author Template. The edits I made can be seen below, all I did was replaced the Workswith with my movies CPT, see below.

 

Before the edits:

 

Workswith: main-single, author

Failswith: archive, category, posts, tags, search, 404_page
 
After the Edits
 
Workswith: movies_archive
Failswith: archive, category, posts, tags, search, 404_page
 
Now the Post Author section is only available on my Movies Archive template.
 

Please Login or Register to see this Hidden Content

 
Here is a screenshot of my PageLines default archive
 

Please Login or Register to see this Hidden Content

 
Here is a screenshot of my Author Template
 

Please Login or Register to see this Hidden Content

 
So this means that if I were to create a custom section, and used the correct template name for my custom post type, that section will only be available on that template.
 
I also created another custom post type, called Books, as you can see from the image below, the Post Author is currently not available.
 

Please Login or Register to see this Hidden Content

 
But as soon as I add books_archive to the Workswith: the Post Author section is available.
 

Please Login or Register to see this Hidden Content

 
So if this isn't working for you, then you most likely do not have your custom sections coded correctly (something we can not assist with), it could be related to your custom post type names in the workswith are not correct or the way you have created your custom post types.

It may well be related to a plugin(s), try disable all non-PageLines plugins and see if this resolves your issue.


#3 idea15

idea15

    Advanced Member

  • Members
  • 58 posts
  • Country: Country Flag

Posted 27 February 2013 - 04:00 PM

Sorry if I wasn't clear. Both sections work perfectly well in magazine_archive. I don't have a problem with getting them to appear on the site, or within the drag and drop section.

 

Magazine is a custom post type. Issues are categories within that custom post type. Contributors are tags within that custom post type. So all of the issues and story contributors fall under magazine_archive. Therein lies the problem: there are content type pages for magazine_archive and magazine as single post. But there is no way to differentiate between a magazine_archive tag page and a magazine_archive category page. If I set the Issue Summary section to workswith magazine_archive, but failwith tag, the issue summary box still appears on the tag archive page, because that tag is stil a subset of magazine_archive.

 

So what I'm asking is, is there a way to set it to workwith on the magazine_archive category but not magazine_archive tag, and vice versa.



#4 James B

James B

    Advocate

  • Members

  • 5126 posts
  • LocationSurrey - UK
  • Country: Country Flag

Posted 28 February 2013 - 02:21 AM   Best Answer

Ok I've read that through a couple of times and I hope I'm understanding it.

 

The only way I think you might be able to do this is to use css to hide the sections you don't want on one template, based on the page class/id and visa versa to display for the other template. Using css to mimic the hiding 'sections' tab we have in the meta settings (but on a more specific basis).



#5 idea15

idea15

    Advanced Member

  • Members
  • 58 posts
  • Country: Country Flag

Posted 28 February 2013 - 09:55 AM

Hi James B, that was exactly what I needed and it did the trick. Cheers!