The MU forums have moved to WordPress.org

Standard page-template that blog owners can "adopt" (14 posts)

  1. Mattz
    Member
    Posted 16 years ago #

    Would it be possible to make a fully filled in page with content that a new blogowner can select and integrate into his page by clicking a button or so ?

    This would be nice that with specific content people only have to make minor changes and have their page ready.

  2. bschwarting
    Member
    Posted 16 years ago #

    how about themes?

  3. andrea_r
    Moderator
    Posted 16 years ago #

    Like the default about page?

  4. Mattz
    Member
    Posted 16 years ago #

    Andrea yes, but blogowners should be able to add it, or it should be unpublished by default.

    The most nice would be if you have a repo for these pages on your mainblog where people can "grab" them from in their Backend.

  5. andrea_r
    Moderator
    Posted 16 years ago #

    Why can;t they just copy/paste it in a new Page? you can list the suggested one in a test blog soemwhere. have it only accesable to site users, and point a message to it from their dashboard.

    Although to be honest, I'm not quite seeing why you would do this.. can you give me an example?

    The included About page can be unpublished, deleted and changed at will.

  6. Mattz
    Member
    Posted 16 years ago #

    Would it be possible to make a plugin that can contain pre-set PHP code and after enabling you can set, or it will automaticly make a menu link for this ?

    I want to I should have a plugin where people can select a module to display as menulink in their page, where every module is a simple .php page what they can use in their site.

    This should already been done I think.

  7. Mattz
    Member
    Posted 16 years ago #

    OK, a step further.

    I can use Templates of course, the problem is that using Templates I have to include this file into every Theme I make, what is far from ideal.

    But it's a start :)

  8. lunabyte
    Member
    Posted 16 years ago #

    Unfortunately, you can't really have your cake and eat it too.

    If you want the user to be able to select the page template, you have to make it.

    Another option would be to create a special web code that they could place into the page, and then you can run a filter on "the_content", and if you find that special code, then process it further.

    Separating it out into a page, by check is_page would help limit it down and keep the check somewhat light.

  9. Mattz
    Member
    Posted 16 years ago #

    Hi Lunabyte,

    Thanks for the comments, indeed, you can't eat and have it at the same time... will be a messy one ;)

    Wouldn't it be possible to have a Page template that is automaticly included in all Themes ?

    That would solve the problem also.

  10. lunabyte
    Member
    Posted 16 years ago #

    "Wouldn't it be possible to have a Page template that is automaticly included in all Themes ?"

    Yes. You have to create it and put it in the theme.

    That's just how it works. It can't really pull a theme out of thin air, you know.

    The only other option is filtering.

    Let's use birds as an example, and you want to have a page which is accessible to everyone, no matter the theme.

    If a user adds a page with a slug of "birds", then you could use that to filter on, and manipulate the page data. Without having to have a specific page template.

    If it's a list of users, then it could be a page slug of "users", or whatever.

    If you wanted, you could have that page as part of the default blog creation, and then if someone doesn't want it, they can remove it.

    Then for your filter, you look for is_page("birds"), filter the text (the_content), and put whatever you want in it.

    OR, you could make a plugin (note, not MU plugin) that automatically generates the page for them, as well as does the filtering. Then you're only running it in places it's wanted, and not loading extra code all the time.

  11. andrea_r
    Moderator
    Posted 16 years ago #

    "Wouldn't it be possible to have a Page template that is automaticly included in all Themes ?"

    Yeah, it's more than possible. And luna mentioned it above.

    "If you want the user to be able to select the page template, you have to make it."

    It's all covered in teh codex.
    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    For example, you can easily set up a page template that has the blogroll code on it and users can then make a page and use the links template and *preto* they have a page with their blogroll/links on it, no coding done by them.

  12. Mattz
    Member
    Posted 16 years ago #

    Thanks for the good responses.

    I ended up with a Page Template in every Theme. The problem is that when I need to change some code I have to change them all, so that is why I was thinking about an centralized version, maybe even using symlinks ?

    For so far, the Page Template is already a great solution.

  13. KKWangen
    Member
    Posted 16 years ago #

    Mattz: you might want to look into my plugin WordPreciousss if you want to add some sitewide settings to your themes. In its current state you can create files that are included in pages if a user add a custom field called pagetype and a value that reflects the name of your file.

    This way you don't have to add a Page Templates to every theme. But currently you can't create new loops with this method, but I'm working on creating real global page templates.

    Anyway, for the current method to work, you need to add the tag precious_pagetlp() to page.php or index.php for make it work for all themes.

  14. Mattz
    Member
    Posted 16 years ago #

    Hi,

    Wow, this is a good plugin I think.

    Maybe it's doable for you to include your custom field as a Page Template in the list ?

About this Topic