Jump to content

Archived

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

clinton4

Custom page/post template with DMS?

Recommended Posts

clinton4

Hi,

 

Normaly when i want to create a custom page/post template to change the way a page/post looks, I would create a custom page template according to the wordpress codex (http://codex.wordpress.org/Page_Templates#Examples)

 

For custom post templates, i use the plugin http://wordpress.org/plugins/custom-post-template/ which works the same way as page templates.

 

Normaly i would do it like this:

1. Open the current themes page.php or single.php file.

2. Add the "Template Name: MyCustomPage" to the top of the file.

3. Make my changes to the html/php code in the file.

4. Save the changed file as my-custom-page.php or my-custom-post.php

5. Create a new page/post in Wordpress and assign the MyCustomPage template.

 

Now, when using the DMS theme, all i see in page.php and single.php is the line setup_pagelines_template();. So there is no html/php code for me to change there. I need to change the html code which makes the way pages/posts looks.

 

How can I achieve this with DMS?

 

 

Share this post


Link to post
Share on other sites
Rob

DMS simplified this exponentially.  Create a page and add your content via Dashboard > Pages > Add New.  Save it. View the page in DMS, making as many changes as you want on other pages of the same type.  Save it.  Then, click Templates, and create a new template, and save the template.

 

You can create as many templates as you like in DMS, and don't need to worry about old, outdated methods anymore.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
clinton4

Rob

 

Hi Rob,

 

I know about the DMS layout procedure :)

 

But this is not what I am trying to do at all. I want to create a custom page themplate where I also can add my php code for my custom fields to display the way and where i want them to. After reading other topics here, i gotten to know that "Custom Page Templates" is not compatible with DMS. Since there is no option to edit "The Loop".

 

So the solution is to use hooks to filter before and after the_content accordingly. Which I find a bit annoying :(

 

But thanks for your time Rob :)

Share this post


Link to post
Share on other sites
Danny

Hi,

 

You can add custom fields via hooks, shortcodes, use a plugin that allows PHP inside the Wordpress page/post editor or create your own custom sections. The choice you have is quite amazing tbh.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
compassl

On a similar note.  I create a page - Edited the layout with dms - input sections and widget areas- I selected some sidebars for those widget compontent and set custom classes for those widgets.  I then saved the template.

The next page I created, I selected the template I just made. When I switched over to dms the layout was the same but the widget settings did not save.  So here is my question. I want to create a template that uses the same component configuration for any page using the template.   I donot want to have to click the load template button for each new page I create, in order to have the same template configuration on those pages.  How can I make things sticky / static.   Lets say I want a specific widget at the top of all pages using my custom template....

Share this post


Link to post
Share on other sites
Rob

DMS should not be doing this, and did not do so in a site I just redesigned from an old PlatformPro installation.  The only thing that could be reordering the widgets, to my knowledge, would be a conflicting plugin.

 

Try deactivating them.  Also, I simply went to the page edit screen, and selected the template I had created and saved.  Cumbersome, yes, but it worked a charm and took only a second.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
compassl
I'm not having reordering issues. If I create a page with a widget section and I select a particular sidebar for that section, when I save that configuration as a template, the next page I create using that template will show a widget section but it won't have the sidebar selected. I want it to save the sidebar I selected when creating the template, not just the widget section. The primary sidebar section is the only thing that works right, you don't have to do anything to make it work on each new page.

Share this post


Link to post
Share on other sites
Rob

I'll report that, but suspect the reason is Widgetizer may be designed to allow changes in widgets with each application, while Sidebar is just one sidebar.  The widgets are there already, so the only choice is whether to use it or not.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
compassl

The question comes down to this. Is dms meant to be used by developers to make creating themes easier or is it to be used by the end user.   If there is no way currently to save a page where you have a permenent left and right sidebar then its not going to work for theme developers.  Since there is only one sidebar section you must use widgetizer if you want to add another sidebar. But widgetizer does not save its settings when you save a layout as a template so every time I add a new page I have to use dms to reselect the sidebar area I want displayed by widgetizer.   I honestly dont know how anyone is using dms effectivly right now if this is the case.    When you create a template, all configurations should save, then the end user will use the admin to make changes. So If I create a layout and put widget areas all over and select a sidebar for each area, the end user can use the widget area in the admin to control the content on the page.

Share this post


Link to post
Share on other sites
compassl
I am using custom sidebars, that's the reason for my complaint. You create a section and put a custom sidebar in it. The next time you use the template, the section is still there but it doesn't save the sidebar selection. So you have to open up dms again and either click load template or manually select the sidebar again. I've been a WordPress developer for 6 years, I don't think I'm missing something. Would love to see a video of someone getting this to work.

Share this post


Link to post
Share on other sites
Danny

Hi,

 

I have just this moment, created two templates, one called Sample Page, the other Other Page. They were both very similar, except that:

 

Sample Page
Right hand sidebar area using Primary Sidebar with text widget showing WP logo.

Content Area/PostLoop Left hand side

 

Other Page

Left hand sidebar area using Primary Sidebar

Content Area/PostLoop right hand side.

 

I create several Sidebars, each with different widgets, I went to the Page editor screen and assigned Sidebars to those pages, when I refresh each pages has a different sidebar.

 

If you want to configure the Sidebar per template, use the Widgetizer section. I replaced the Primary Sidebar section with the Widgetizer in my Sample Page template, then assigned a new Sidebar area to it. I then updated the template with these changes, I then selected a new page, my Blog page and then clicked load template. When the template refreshed, my blog displayed posts on the left hand side and had the Widgetizer section with the text widget and WP logo displaying.

Therefore, I am unable to recreate your issue.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
compassl

You clicked load template... Thats what I donot want to do. Do you know how silly that is if after every new page you create you have to use dms to make it look right.  This is wordpress guys, lets not change its very essence of having pre coded templates to select so you can create as many pages as you want by just entering a title and some content then saving.    Throwing in the extra step of turning on dms and clicking the load template button is completely unacceptable.   Im handing my websites over to clients who donot want to deal with dms.   We should be able to create page layouts that permanently have the settings saved and then if someone wants to make changes they can choose to load dms, not be forced to do it.  If I put widgetizer in a template and select a sidebar and save the template, every new page that uses that template should see the sidebar I selected when I saved the template.  This goes the same for all components, if I decide to use a text box to imput my logo into the body of the page, the next page I create I dont want to see an empty text box where my logo could go, I want to see the image code I saved when I created the template.

 

Templates should never be page specific - If I create a template for inner pages and select it as global, If I make a change to that template it should be reflected on all the pages using that template.  If a page needs something custom then you could save a new template for that page.

 

I used jing to record a video of whats not working. http://screencast.com/t/3JvZI6GmNlpm

Share this post


Link to post
Share on other sites
Rob

@compassl  I watched your video and listened very intently to your comments.

 

What you're experiencing isn't usual.  In fact, it's abnormal.   I mentioned earlier that I created/saved templates in DMS, then, directly from the page creation screen in WP, simply assigned the saved template to the new page and saved it there. It worked.  Took only a second per new page to assign the standard templates I created.

 

You may have a plugin conflict causing some of it but I suspect some of the problem may also be application of custom classes to the Local, not global.  For example, I don't know where or how you applied the custom class for your menu, but clearly that vanished from your new page.  If it was created on a local basis on the original, then when you change to a new page, those classes will not be applied.  Personally,  I would never apply any custom classes on a local basis, especially for the header, footer or sidebars, but that's just me.

 

I'd have to delve into the way you're doing things, what plugins you have and what's being done on the site to know for sure, but what happens there is not normal and not how DMS is supposed to work.

 

I also question, respectfully, the use of the Widgetizer in this case.  As our docs point out, you can create custom sidebars and place those on your template in the side column(s).  Once you do that, and place widgets in them at Appearance > Widgets, they're locked if the template is properly updated with the current settings you see on screen.  If you don't update the template, as well as publishing the page, then when you go to use the template again, they will not be there... so there's questions I have about lots of things.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
compassl

Ok here is a video with all my settings and the process I used to create the template. Please let me know what Im missing. http://screencast.com/t/wNwi44ewb7iL

I dont have plugins installed and I did fallow the sidebar instructions http://docs.pagelines.com/advanced/custom-sidebars

I did purchase a premium dms subscription but Im not going to use it until I make sure I can get the basic to work.

Thanks

Share this post


Link to post
Share on other sites
Rob

As it turns out, Custom Sidebars strips the coding for normal widget elements, essentially removing things that would allow normal CSS built into DMS to format the look and appearance of sidebar widgets.

 

Things like widget-title, are gone, when using the plugin, thus whether you use Widgetizer or Columnizer, the formatting is removed.

 

I found this, http://codecanyon.net/item/total-dynamic-sidebar/3287804  but haven't tested it yet. I hope to get to this tonight.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Rob

I watched your video, and you've made two errors.  First, you saved your changes to the Features template. Then, you made the Base template the global default.

 

Also, you said you had no possible conflicting plugins, but right there, in plain sight, you have a tinyMCE editor plugin.  That can cause plugin conflicts too.

 

I note too, you're moving very fast.

 

Lastly, as I stated above, we've discovered an issue with the Custom Sidebar plugin, which strips formatting.  This seems to be a non-DMS issue, and affects other uses of that plugin.  I have tested http://codecanyon.net/item/total-dynamic-sidebar/3287804 and it absolutely works.  It does not strip any formatting.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Erwan

Hi Rob,
 

Lastly, as I stated above, we've discovered an issue with the Custom Sidebar plugin, which strips formatting.  This seems to be a non-DMS issue, and affects other uses of that plugin.  I have tested http://codecanyon.ne...sidebar/3287804 and it absolutely works.  It does not strip any formatting.


Does it mean PageLines doesn't recommend anymore Custom Sidebars for DMS?

See inline help for Widgetizer section: "We have detected that you don't have the Custom Sidebars plugin installed. We recommend you install this plugin to create custom widgetized areas on demand")?

Share this post


Link to post
Share on other sites
Rob

@Erwan  That's not a decision I get to make.  I found, with some of my moderator colleagues, after a customer complaint, that the formatting... literally all the CSS elements themselves, are stripped out of the Widgetizer or Columnizer when used in conjunction with Custom Sidebar plugin.  You get default text with no ability to customize the look and appearance with CSS.  Inspection of things like widget titles shows there's no elements to modify.

 

When I used the plugin from Codecanyon.net, both Widgetizer and Columnizer worked perfectly and I was able to assign changes to custom CSS for any element in a widget. By default, they looked exactly the same as they do in Primary Sidebar.

 

I cannot say where policy is going to go, but from the perspective of helping customers,  I am recommending the Codecanyon plugin.  Because Custom Sidebars is free, they may leave the language as it is in DMS.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
studioc5

Im still having the same issue, the templates are not saving.  If I put a text box in a section, enter some text and save the template.  The next page I create using that template displays an emty text box instead of the content I saved in there when creating the template.

Share this post


Link to post
Share on other sites
Rob

If you add text to a TextArea and then save the template, you're saving a template with an empty TextArea.

 

Publish the page first, with your content, then save the template, but you're using the concept of a template wrong. It doesn't just copy the saved page elsewhere.  The purpose of templates is to save the layout, or structure of the page, not its content, for use in another page.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
studioc5

Wordpress templates always have built in widget areas, some pernanent footer text,  maybe a newsletter signup, a left and right sidebar.    I want to save all these things into a template, the only thing that should change page by page is the content in the post loop area.   This is how wordpress should work, has dms done away with this ?

If I want to put a contact form at the top of every page, I should be able to do that by placing a sidebar where I want it or a block of code in a text box and then save the template.

 

As a developer you would never create a template with lets say a left and right column for a sidebar but not include the sidebar in the code.  If I split the page into three columns and add the main sidebar in left and drop a widgetizer area in the right, I would select a particular sidebar that should be permanently in the right column.  But with DMS o no, we must make the user re select the sidebar on every new page he creates.   This is just rediculous.

 

If I add a class to column it should save also, I hate loosing all my formating on every new page.

Share this post


Link to post
Share on other sites
Danny
studioc5 Yeah, this looks as though its actually a bug, I have reported this for you.

Please search our forums, before posting!

Share this post


Link to post
Share on other sites

×