Jump to content

Adam Kiss

Moderators
  • Posts

    1,303
  • Joined

  • Days Won

    7

Everything posted by Adam Kiss

  1. No harm done! Though, after little thinking I agree with you! If we write it there, we can save new PW users a little confusion! And us some stupid questions
  2. Hi Fionnan, everything is possible. Can you post some example site tree and how exactly [based on this example tree] you want the children split between two menus? I.E. calrify a little? So we can find the right key how to split the children or find the right code to what you want to do.
  3. @martinluff – isn't that a bit common sense?
  4. @martinluff: To me it seems he needs sitewide navigation than subnavigation. And the homepage check is there, so if you are on homepage, subnavigation doesn't get rendered [so you don't and up having navigation AND subnavigation the same]
  5. If I may suggest, something like modal editor makes more sense, because front-end anything implies, that that's what you edit. But you merely pushed the administration into modal and added few buttons [though that this statement doesn't make it any less valuable!] Maybe something like 'modal editor', or 'enhanced inpage user control' [although that's bit strange]
  6. Edit: I replied to a different thread. Fucking confusing previous/next buttons. OT: Ryan, SMF is ugly and bad. Don't you want to try vanilla forums instead? Ryan: It actually shows a need for deeper API documentation [hint hint]
  7. Hi buio, as Ryan mentioned, there is a way. There always is. But actual implementation differs based on how tight you want the two to be integrated, and what you want to accomplish. So, please let us know more, so we can give you some advice. Adam
  8. Hi Bhammeraz, welcome to forums. As I understand it, you want to show the very same navigation [with children of root] on every page. therefore you can't use $page->children(), because in your templates, $page refers to page that's currently opened [therefore children() refers to different pages everytime] you want rather use something like this: <div id="sidebar"> <?php echo "<ul id='subnav' class='nav'>"; foreach($pages->get('/')->children as $child) echo "<li><a href='{$child->url}'>{$child->title}</a></li>"; ?> </div> This first selects root page as reference and then iterates through it's children [i.e. first level pages on your site] Adam
  9. I'm actually starting to think, that it should be done via some 'partials' system... The same way you define templates, you define 'partial-templates' [or 'repeatables'] and the only thing we would have to add as field would be something as 'repeatable-select', which would then point to one repeatable/partial template.
  10. If you want user notice, that page saved was why not: Add hook to save, so it sets in session [if saving from modal] that $last_saved_id = $page->id Save in modal Close modal / or just: Reload hook on page load – if $page->id = $last_saved_id; show 'Saved OK' message, else delete session information, because something happened [user moved away?] Everything is just a matter of will
  11. Apeisa: if you post the code somewhere I might try to hack it, so after save it closes modal and reloads window. Or you coould do it. After saving, there could be this code [pseudo code]: $(document).watch-for('modal.urlChange', function(){ if (:contains('Saved')) window.reload(); }); modal.urlChange – I'm not sure what modal are you using, but it should have some event after contents of modal have changed window.reload(); – since after change we check DOM of contents of modal for 'Saved' or anything that shows that page has been saved, we just reload the page – so with one 'Save page' click, it saves page and basically closes modal AND opens saved page with changes. modal change real code depends on what modal are you using, :contains code depends on what's the real DOM of edit page dialog (or how to identify 'saved page' message) and window.reload() is just a question of looking up the right code.
  12. @Sevarf2: actually, since via API you can put into your users (as Ryan pointed out, a bit messy ATM) anything you want, so [as I understand it] you can do THAT totally right now. Imagine /register/ link: (and the template contents are heavy pseudo code) <?php /* templates/register.php */ if ($_GET['registering']) do_validation(); if($not_valid){ edit_register_form_to_show_errors(); }else{ $register_him = new User(); //this isn't pseudocode! $register_him->name = $validated_form['name']; .. $register_him->last_custom_val = $validated_form['last_custom_val']; $register_him->save(); $session->redirect('/register/thank-you/'); } do_show_empty_or_erroneous_form(); ?> Now you actually have new user, who can login to PW (if you gave him sufficient rights) with all custom data in your DB @martinluff: but looking better... hot yoga mums are such a rarity these days... it's mostly that old really flexible dude again.
  13. But I bet you can figure that out – after all, you built the awesome basics we love to build upon. Hey, that's actually pretty catcy headline! Awesome foundation you'll love to build upon ;D
  14. Great minds think alike! You're making me sad [ :-\ :'(], because you just did what I was thinking about (customizable 'PW widget' for logged in users), although I don't like the modal part (but that's just me ) But just as Ryan, I'd like to help to have it bult as module/plugin – [just as few posts above ]
  15. thumbs up! I'm just hoping, that creating different parts of content – users, templates... won't end in having yet another CMS with custom fields
  16. There are some features to simplify content managment on the roadmap I'll write more in about an hour.
  17. As I said in the other question in modules – it might be sometimes hard to wrap your head around possibility of anything, but that's how it works Adam
  18. Hi there almonk, welcome to forums! Not sure I understand your needs though. What do you want to do with this repeatable? Because basic idea of PW is that everything is repeatable. You just define new 'template' type. And then, in the one template that should show this 'repeatables', you API your pages of that repeatable template based on their location/other paramaters like this: echo $page->body; //echo something from the 'page with repeatables' $reps = $pages->find('template=repeatable, ...params'); foreach($reps as $rep){ //here you go, array of 'repeatables' to go through } I know, sometimes it's hard to wrap your head around this seemingly endless possibilites, but in the end, you can gain a lot from having clear, custom defined structure. Everything is possible. Edit: I mean, even if you look at this picture from Matrix plugin: It really does resemble template creation
  19. Ryan: I don't think 'either' it's a good idea! Actually, system should have only on/off settings and if something, then have a 301 redirect to the active setting from both. e.g. you have trailing slashes off, so /page/subpage works, but /page/subpage/ does redirect to aforementioned This is especially important – to not have duplicated content!
  20. I've been once again defeated by the simplicity of PW! @Ryan, is it possible somehow (now or in future) to remove the trailing slash? @OP: Also, there should be possible to add hook while saving page, so it would automatically add '.html' extension to your page name (/url/slug), if we can solve the trailing slash question.
  21. Actually, hidden pages are ideal. Just put them into root next to 404 and other hidden pages. Have one root with url '/countries/' and in your template, you'll even have quite self-explaining code like echo '<select>'; foreach ($pages->get('/countries/')->children() as $country) echo "<option value='{$country->name}'>{$country->title}</option>"; echo '</select>'; note: this is considering you left original 'title' field as name for that country this all is good, when you don't wish to have any content for countries. If you do, reconsider placement of 'countries' parent to be better placed in your site structure More information about data import automation: How do I import lots of data into pages?
  22. Could you try this? 1., create dedicated function, which does something like this: function URLize($url){ $new_url = substr($url, 0, length($url-1)); $new_url .= '.html'; return $new_url; } then in your templates: echo URLize($that_page->url); 2., edit .htaccess' line 43 to something (and I'm not sure it's 100% correct) like this: RewriteRule ^(.*).html$ index.php?it=$1 [L,QSA] And I'm like 80% sure there is currently no better solution.
  23. I don't think there is currently better solution Why can you create page for every country? with API, you can automatize it, i.e. create template, which parses some CSV and adds children to a hidden page, call it once and you're all done. Is there any problem with this?
  24. I will be preparing module for more then just edit link later, so if you finish your 'admin bar' drop me and e-mail and maybe I can build upon it then (with proper credits, of course!) adam@kissyour.net
  25. Sidenote: I don't think SE do care about your URL schema, it's more things like keyword density, inbound/ooutbound links, etc. But Ryan (the creator) should be here in around two hours, so he'll answer your question
×
×
  • Create New...