Jump to content

Configuring templates - family settings


SamC
 Share

Recommended Posts

Ok, so I didn't think I'd be back quite so fast being a forum pest but this one's got me pretty confused. I've followed another tutorial and what's happening to me is different from the video, probably I'm running a newer version of PW. I have two templates blog-index.php and blog-entry.php.

blog-index.php is a one off. No other pages should use this, just /blog/. blog-entry.php pages are children of blog.

So I wanted to use the shortcut to 'Add New' to be able to create a blog entry, which automagically files the page as a child of blog. When I try and set this up, I get the following mesage (and still only 'Bookmarks' under the 'Add New' button):

Templates indicated with ♦ also need to be configured to allow this template as a parent. Click any selected template as a shortcut to configure allowed parents.

Now, when I check the dropdown above this, a few templates have a '♦' next to them, namely 'admin', 'permission', 'role' and 'user'. What else do I have to do here? I'm not sure why I'd have to configure these other templates in order to only allow blog entries under blog. What do the other templates have to do with this? Tried searching around for this to no avail.

My past experience has shown me that I don't expect clients to be able to 'work out' where stuff goes, only to add predefined pages to predefined places (the 'Add New' shortcut button seems ideal for this), and to edit select content types (not sure these exist in PW). In Drupal, I set very rigid permissions of what they could or couldn't do using roles and permissions settings to avoid that phone call when you're on another job "The menus broken" (because they created too many top level pages and your cool CSS menu is now over two lines :P). Looking to do something similar.

Thanks in advance for any advice.

Link to comment
Share on other sites

in my case the two templates are 'blog' and 'blog-post'. 'blog' is the parent and only used once, while blog-post is the child and used many times. In the 'Family' tab on the template page for 'blog-post', I have things set up as in the attached image. This template cannot have children, but can be used for new pages. Its only allowable parent is 'blog'. If you go on the 'blog' template, the dropdown for allowed chidren will have a tick (checkmark) against 'blog-post'. This relationship between templates only needs to be set from one side to work, and I usually do it from the child template since it is when I am editing that that both sides of the relationship exist. 

Edit Template blog-post • samedaynextday.co.uk.png

  • Like 3
Link to comment
Share on other sites

Have you created the Blog page?

I had the same happen to me, in my case i didn't have the parent page created.

So to add a new blog entry, that is a child of blog, you first need to create its parent page.

Go to the pages tree in the admin, hover over home and add a new page (your blog template).

Link to comment
Share on other sites

On 7/24/2016 at 2:08 PM, DaveP said:

in my case the two templates are 'blog' and 'blog-post'. 'blog' is the parent and only used once, while blog-post is the child and used many times. In the 'Family' tab on the template page for 'blog-post', I have things set up as in the attached image. This template cannot have children, but can be used for new pages. Its only allowable parent is 'blog'. If you go on the 'blog' template, the dropdown for allowed chidren will have a tick (checkmark) against 'blog-post'. This relationship between templates only needs to be set from one side to work, and I usually do it from the child template since it is when I am editing that that both sides of the relationship exist. 

Edit Template blog-post • samedaynextday.co.uk.png

I see, and the little tick is present. Working now.

On 7/24/2016 at 2:27 PM, fbg13 said:

Have you created the Blog page?

I had the same happen to me, in my case i didn't have the parent page created.

So to add a new blog entry, that is a child of blog, you first need to create its parent page.

Go to the pages tree in the admin, hover over home and add a new page (your blog template).

Yep, done this bit.

9 hours ago, ottogal said:

Did you use the Page Add Bookmark Editor to create the wanted bookmark under Add New ?

Doh! I thought it was automatic for some reason one the relationships were set up. So it works now, but it's not intuitive enough for a client. See the screenshot. 'Add New > Blog...' They wouldn't be adding a new blog, just a single post.

Not really what I had in mind, should really say 'Add New > Blog entry'. I see it's using the 'title' field of the blog-index.php template, which is simply 'Blog'. If I change this to 'Blog post', the shortcut becomes 'Add New > Blog post' (but the displayed main title on the webpage also becomes 'Blog post', and the main navigation entry etc...). So, I thought maybe I could create a new field called 'shortcutText' in blog-index.php and use that to display whatever I wanted. However, not sure how to get the text into that dropdown seeing as it's using the 'title' field. That make sense?

How do you guys handle this? Thanks for the replies so far, it's really helpful to get me up and running.

 

Screenshot 2016-07-25 17.40.12.png

  • Like 2
Link to comment
Share on other sites

32 minutes ago, SamC said:

Doh! I thought it was automatic

They are automatic.

The automatic links have a plus icon while the bookmarks have an arrow icon.

Does your blog page have the correct template?

Link to comment
Share on other sites

additionally to the family settings described above, you can enable / disable "add to new" (... something). It is enabled by default, but better you check this for the child template.

Link to comment
Share on other sites

12 minutes ago, fbg13 said:

They are automatic.

The automatic links have a plus icon while the bookmarks have an arrow icon.

Does your blog page have the correct template?

Yes it does. Now I know there are different icons, I can see that that 'Add new > Blog...' has an arrow. So what I've done now is the following, which works automatically which is awesome and just what I wanted. I had only set the (child) relationship on blog-index.php, but it seems you also need to set the (parent) relationship on blog-entry.php so the system knows this page can only go in one place with no ambiguity. This is an educated guess but any other method I tried (setting just one or the other) resulted in 'Add new > blog-post' disappearing out of the menu.

 

Screenshot 2016-07-25 18.53.38.png

Screenshot 2016-07-25 18.53.49.png

Screenshot 2016-07-25 18.54.08.png

  • Like 2
Link to comment
Share on other sites

2 minutes ago, horst said:

Nice, now you have found it. I have posted a link to another explanation for the rescue. But you don't need it anymore. :)

Thanks for that. Just playing around with it, I like to know what's possible before embarking on anything. Plan first, make later! I see this setting:

Admin > Setup > Templates > Edit Template: blog-entry > Advanced (tab) > 'Label for Page Name property'
(Optionally override the default "Name" property label.)

I changed this to something, tried creating a blog entry, had a look around, but (1) what does this field actually do? And (2) why do I get two links on the following page? (when I click '+ Add New' in the Pages dropdown).

Screenshot 2016-07-25 19.12.39.png

Link to comment
Share on other sites

You can have more add new pages (add new blog entry, add new event, add new gallery etc), so when you click the Add New link it doesn't know what kind of page you want.

That's why you get that page so you can chose which one you want.

Not sure if having only one should be different.

  • Like 1
Link to comment
Share on other sites

13 minutes ago, adrian said:

Now add a label to the "blog-entry" template so that it reads "Blog Entry" or "Blog Post" or whatever you want.

Screen Shot 2016-07-25 at 11.12.47 AM.png

Awesome! Totally hit the mark :lol:

4 minutes ago, fbg13 said:

You can have more add new pages (add new blog entry, add new event, add new gallery etc), so when you click the Add New link it doesn't know what kind of page you want.

That's why you get that page so you can chose which one you want.

Not sure if having only one should be different.

What I mean is, now I've changed the labels, things are looking much more like I would expect. Just wondering why this happens, with both grouped links pointing to the same place.

+ Blog entry
 Blog >
------------------------------
+ Services entry
 Services >

I would expect:

+ Blog entry
------------------------------
+ Services entry

 

Screenshot 2016-07-25 19.27.37.png

Link to comment
Share on other sites

Child pages can have multiple parents of the same template, so they are listed there to chose a parent for you're child page.

Just my guess.

ylsMekZ.png

If i click on terms i get on a new page to chose a parent

vo7BzYE.png

Clicking on a parent skips that page.

  • Like 5
Link to comment
Share on other sites

13 minutes ago, fbg13 said:

Child pages can have multiple parents of the same template, so they are listed there to chose a parent for you're child page.

Just my guess.

ylsMekZ.png

If i click on terms i get on a new page to chose a parent

vo7BzYE.png

Clicking on a parent skips that page.

Yes, of course, nice! Haven't got into taxonomy yet but the powers of PW are revealing themselves in a most pleasing way. Everything so far seems quite sensible with no outrageously complicated abstractions (looking at you Drupal 7).

  • Like 4
Link to comment
Share on other sites

3 hours ago, ottogal said:

Learned something new here, too. :) Thanks to all.

Yep, me too. I'm guessing that maybe half a dozen people know PW well enough to be familiar with all the clever stuff available. And that is in no way a criticism - it's just that there are so many cool features (and more added almost weekly) that us mere mortals (me anyway) struggle to keep up.

But it's an absolute joy to see threads like this.

  • Like 4
Link to comment
Share on other sites

  • 3 years later...

I tried and followed these steps :
image.png.77f01929b88815c3c68fe54a6926375c.png as in the pic I have two templates floodcases ( this is list template to list all pages ) and floodsinglecase ( which is actually I want to see in the Add New Button >> FloodSingleCase

I done this image.thumb.png.6cd19fe62f5e8f4456ecf8f9da8f245b.png

 

and this image.thumb.png.3212f1d0fffb661d5d96f4959b9c96e8.png

 

 

but I still dont see the option in the Add New Button : image.png.bd859b88f78f334730a6995d63718e39.png

 

What could be the wrong step I am following now ? Any help would be thankful

Link to comment
Share on other sites

4 hours ago, JeevanisM said:

What could be the wrong step I am following now ? Any help would be thankful

I don't see anything obviously wrong in your screenshots. This is probably a dumb question, but just checking: you've also added a page using the "floodcases" template somewhere? ?

Link to comment
Share on other sites

13 hours ago, teppo said:

I don't see anything obviously wrong in your screenshots. This is probably a dumb question, but just checking: you've also added a page using the "floodcases" template somewhere? ?

I think I did not  but will check again and update

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...