Jump to content

SamC

Members
  • Posts

    733
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by SamC

  1. Awesome! Totally hit the mark 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
  2. 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).
  3. 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.
  4. I see, and the little tick is present. Working now. Yep, done this bit. 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.
  5. 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 ). Looking to do something similar. Thanks in advance for any advice.
  6. That's some awesome info, thanks! Will probably try and get Twig up and running at some point, I find PHP mashed in with HTML all over the place quite difficult to comprehend sometimes.
  7. Yeah for sure! Been creating a simple blog page with a couple of new templates (blog-index.php and blog-entry.php). Wanted to show submitted by date and name (other than my username). Thanks to this forum (how to add fields to system templates) and a youtube video (general templating and curly braces usage within a string, handy!), managed to cobble together: //blog-entry.php $publish_date = date('d-M-y', $page->created); //custom field displayname in user template $created_by = $page->createdUser->displayname; $content = "Published on: {$publish_date} by {$created_by}"; //show above post entry body field $content .= $page->body; Seems quite straightforward so far (famous last words), feels like Craft, but without Twig. I've got a fair bit of free time at the moment which doesn't happen all that often so a great opportunity to learn Thanks for making me feel so welcome everyone.
  8. Excellent, thanks a lot people. This is exactly what I'm looking for. The thorough looking documentation will certainly keep me busy for awhile
  9. Hi DaveP, Thanks, that was most useful. So would you do stuff like: if ($page->field) { echo 'field value here'; //or whatever } What I'm asking is if a page field can either (1) not exist, (2) exist and be empty or (3) exist and contain data, to get the value or print nothing to screen (without errors), will points (1) and (2) both return NULL? Or do you first have to check a field actually exists? Thanks.
  10. Hi, New to PW and more a designer than a developer, currently learning Javascript with basic knowledge of PHP (on the never-ending todo list) and beginner level experience in other languages, C++, Python, Java. I have used Umbraco, Drupal 7 (mainly), Wordpress, Craft CMS (my favourite for past year or so) before this and CMS is something I love playing around with! I am looking for something I can get more permanently involved with and I had a good look over the code for the 'Default Site Profile (Intermediate Edition)' PW site. As far as my PHP knowledge goes, I can decipher renderNav(), but I'm struggling with renderNavTree(). One thing I don't get initially is this in '_init.php': $title = $page->get('headline|title'); // headline if available, otherwise title $content = $page->body; $sidebar = $page->sidebar; I understand that these variables are for usage elsewhere as defaults. However, why does the $title variable need '$page->get' when the other ones just need '$page->body' and '$page->sidebar'? In '/setup/fields' I can see that 'title' and 'body' are both fields so not sure why these are different. Any advice is most appreciated. Thanks.
×
×
  • Create New...