Jump to content

Archived

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

hermit

Use WordPress templates

Recommended Posts

hermit    0
hermit

Hello,

 

I need to load a WordPress template (so not a PageLines template), because I need to load different scripts and markup on one page. How do I do this? The WordPress template meta box is gone and replaced by a DMS Page Setup box on Page Edit pages.

 

Or can I overwrite the code of a PageLines template? Like if the PageLines template is called 'Game', I can override that by creating a file called pl-template-game.php? If I could just copy the contents of header.php and footer.php in there, add some scripts and add my own markup (for a JavaScript game) I'd be happy. This is very easy to do with normal WordPress. 

 

I do hope that there's a solution because it'll be a real bummer if DMS can't do this. Thanks for replying!

 

 

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

 

I apologise, but I don't know what you're trying to do, can you explain in greater detail please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
hermit    0
hermit

Hi Danny

 

I'm trying to load a JavaScript game on a page in a DMS website. To do that I need to load extra JavaScript files on that page and use custom markup. The easiest way to do that is to create a WordPress Template file and assign that to that page. This works for most any theme/framework, also worked in PageLines Platform 1.x. I can't load a WordPress template when DMS is running, because the option to load one is gone and replaced by PageLines templates.

 

This is how I would do it on any other theme:

 

I create template-game.php and add that to the theme.

I add this to the header:

 

/*
Template Name: Game
*/
 
Now it is a WordPress template. I can copy the contents of header.php and footer.php into that file and add my own scripts and markup for this specific template.
 
 
 
My other question is, if DMS breaks the default WordPress Template functionality, what is done to repair the loss of functionality? Can we create custom code templates for PageLines Templates?
For example, if the PageLines template is called 'Game', can I override the template creating a file called pl-template-game.php or whatever it needs to be called? 
 
If this is not possible, are there special hooks for PageLines Templates? Like, 'game_pagelines_head', 'game_pagelines_content' ? That would be an acceptable solution, although it's more work than the default WordPress Template system.
 
Thanks!

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

You can't create templates like that and couldn't that in PageLines Framework either. This is because of the way DMS has been designed, if you were to use normal custom templates, then you wouldn't be able to use DMS functionality.

 

Without seeing the code you're going to be using, its difficult to say how to best implement it. However, what I would suggest is for you to probably create your own section, but if you can provide the code you're going to be using, there may be alternative solution.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Claude203
      By Claude203
      This is probably a simple problem to fix, but right now I am new to DMS concepts and therefore I'm stuck and can't seem to figure it out.
       
      On my pages, the page titles are no longer showing up at the top of the page, as they did before. No problem for posts, where the post titles populate just fine. But when I try to make a change to pages, the templates for the entire site change as well, also altering post layouts. So for example, on one particular page I want to make it a full width (no sidebar) layout, but when I make the change on that page, all other pages and all blog posts now suddenly have no sidebar as well. Every time I try to start over by creating a new page from scratch, any change I make there also changes every other page/post. I know this has something to do with templates and how they are linked to posts/pages, but I cannot figure out how to unlink them or what else it could be. 
       
      Thank you.
×