Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. That's what I was trying to communicate, but no luck. It's what I do in a similar situation and it's the perfect solution to this problem. The paragraph stripper is exactly built for this. But why simple if you can make it complicated.
  2. Thanks seb this has been fixed in the latest commit.
  3. Soma

    ProcessWire on the web

    Couldn't resist to give my tow cents too...
  4. But you still use language fields, so 1 page has multiple languages? The "best" way to modify the urls is to hook Page::path and prepend the lang segment. But this will only modify urls you spit out with echo $page->url and PW will not recognize these urls, so you'd have to implement another code to request the right page depending on the new url. Kinda what LanguageSupportPageNames does, so why removing it?
  5. Or with a different parent than "/" root. ... $parent = $pages->get("/parent/"); $res = $modules->MarkupSimpleNavigation->render($opts, null, $parent); ...
  6. With the MarkupSimpleNavigation you could do it like this: $opts = array( "max_levels" => 3, "outer_tpl" => "", "inner_tpl" => "", "list_tpl" => "", "item_tpl" => "{id}|", "item_current_tpl" => "{id}|" ); $res = $modules->MarkupSimpleNavigation->render($opts); $res = trim($res, "|"); $allPages = $pages->find("id=$res");
  7. Soma

    ProcessWire on the web

    These guys really have balls to write something they have no clue about.
  8. Soma

    ProcessWire on the web

    http://www.quora.com/WordPress/How-does-Processwire-compare-to-Wordpress/
  9. No need to, read again my post: There's a paragraph stripper already coming with PW: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Textformatter/TextformatterPstripper.module$$ Just add it to the text field after Textile formatter.
  10. If a textformatter uses fomatValue you could hook into a get the field $this->hookAfter("TextformatterTextile::formatValue", $this, "hookTextile"); ... public function hookTextile($event){ $field = $event->arguments("field"); $value = $event->arguments("value"); if($field->type == "FieldtypeText") $value = str_replace(array("<p>","</p>"), "", $value); }
  11. Textile Textformatter still uses deprecated syntax public function format(&$str) { New is public function formatValue(Page $page, Field $field, &$value) { So you can't hook into and check for the field Just add a second textformatter already in core "TextformatterPstripper" (wich uses the old syntax too btw) after the textile formatter on your text field. Easy.
  12. It's not possible (as far as I know) to limit the levels via a find selector. If it's for listing output you have to write nested traversal function (see sitemap code in default profile) or use a module like MarkupSimpleNavigation
  13. Yeah I dont even know what to respond.
  14. Wire holds the api vars not a module. Like wire('pages') etc. You get or load the module with $mymodule = wire('modules')->get('ModuleName'); Or same $mymodule = wire('modules')->ModuleName; Or on templates $mymodule = $modules->ModuleName; What you have is correct, but get or load a module will load it explicit whether autoload or not. It will even install the module if it's not. Where not doing a call via API, an autoload module will get loaded still. So you dont need to or cant check to see if the module is loaded, at least I haven't been able to.
  15. Shame both videos show you guys and I dont see the slides. And mademyday: nice talk but before the next presentation go make pee. so you can hold still. Yellowled nice talk, some little details were not correct and me as a hardcore noticed of course but otherwise great, big thanks for spreading the word. Enjoyed watching them.
  16. Reality is what make out of it.

  17. Soma

    Dead Simple Grid

    I use pocketgrid which is the same basicly. I use it all the time. On mobile so no link.
  18. @bwakad It's simple.. if you think about it, your separate structure won't work cause it's not nested and thus parent=selected_parent. Isn't working there. You would maybe need some different selector then, but not possitive it's possible. You need to be able to make some connection like the parent > child.
  19. Yea I remember Ryan mentioned it somewhere but didn't remember it was already in and working dynamicly without saving page. That's a useful feature, just a shame nobody knows.
  20. Field dependencies, .. not sure if that would work, as this would require to reload the second select. And field dependencies isn't able to define what the page field has for the parent. As kongondo mentioned not a trivial thing, and may require some magic ajax. But maybe not. EDIT: My bad, I completely forgot this is possible in new version 2.4 with using a custom selector (as described in next post) I forgto about it and remember now Ryan mentioned it in some thread and to be forgotten... There's currently no out of the box UI solution. But you could kinda can make it happen with selecting the first select, save page, selecting the second. You can use the "custom php code" of the page fields "Input" settings tab. Instead of a parent or custom selector you would have this kind of code in the second select and read the saved value of the first. So reading again your post... If you have them nested as pages like: - state1 - city1 - city2 - state2 - city3 Then the first select: "states_select" = is the page field single select to select states, using a parent or template. Then in the second select let's say "city_select", you would use such a code to populate the page select: if($page->states_select) return $pages->find('parent={$page->states_select}'); "$page->states_select" is the first select field on the current page. So if a page is selected there we will use a selector to get all children of the parent and return the page array to populate the second select. Edit: with some clever hooks you could add some javascript to the admin that handles the updating, either via ajax or adding an event listener for an on change of the first select and save the page by triggering the save button. Don't try this as it can corrupt your page.
  21. Ah diogo is right if($page->url == $page->url) is not same if($page->url == $_SERVER['REQUEST_URI']) in the context of being rendered by render()
  22. Sorry to dive in late. Diogo's code would be equalent to: if($page->url == $page->url) throw .... Just looks cooler, but however I would simply not create the php template for those pages and create a separate template file. If your template would be "subpage", create a partial-subpage.php And render the subpages on home with echo $subpage->render("partial-subpage.php"); And since you don't have a subpage.php those won't be viewable anyway. Redirect: What you also could do is have the subpage.php redirect to the home with a hash /#yoo appended, so you could scroll to the panel and also use that url for indexing. $session->redirect("/#" . $page->name);
  23. As for installing modules. In PW 2.4 you don't necessary need Modules Manager to download and install modules. Instead of donwloading and put folder in modules folder, you could've done it via PW module page. Go to the modules page in admin and go to tab "New", enter name "ModulesManager" (class names are always unique and in this kind of format "SomeName", you'll see that name on module details screen on modules.processwire.com) and submit. It will look for the module and if found allow you to download and install it directly from within admin. This you could've done with the "JqueryDataTables" module too. Just copy and enter the name and go to "New" tab. If a module has all required modules installed it won't show the "requires" note. To make sure that you don't have the module already downloaded you could search the module screen and look under "Jquery" section.
  24. No problem. I'm glad you actually brought this up. By saying "it's probably wrong thread", I meant that the problem you had there isn't directly related to Modules Manager but installing modules in PW core module manager in general. For me and others it seems to be clear that if it shows "Requires: SomeName" means that it's a module that is required to be installed (since you can't install it) This is always a module, and never something else. The requires dependency is something handled by ProcessWire and not Modules Manager. So Modules Manager isn't responsible for it, I just tell ProcessWire what Modules Manager requires as a "JqueryDataTables". I don't have influence on how this particular feature shows and works within admin core module page, since Modules Manager it isn't even installed yet at this point. After all it's fine, at least you posted something (a concern) that maybe helps us improving it. We are all for improving things, but this hasn't really come up for anybody, but that doesn't mean it couldn't be improved. It shows... ... it may not clear for some what "requires: SomeName" really means. Along with that you can still click on the module name and opens an alert, that doesn't say much. I think this is a "bug" that needs to be addressed by Ryan. So please file an issue (or someone else) on ProcessWire github, explain it or link to your post. ...Modules Manager readme needs an update with a note about requirements. I think some more, clearer "newbie-friendly" instructions could be implemented by Ryan for the module installing process. So will I need to for Modules Manager (kinda same story) I also just updated the readme and this threads first post. Thx.
  25. This is wrong thread for this to be discussed. For me I assume you know what a module is and how to search for it, and finally install it. But as said this has nothing to do with Modules Manager.
×
×
  • Create New...