Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. That is because the module is singular. Same instance same hooks, and as far as I know you can't know what the source is, whatever that would mean. If you set "singular" => false, you could create a new instance that will be separate with hooks. But I think you could also define the item content using a property hook and use that to output custom stuff. wire()->addHookProperty("Page::itemCode", null, "itemCodeHook"); function itemCodeHook($event){ $page = $event->object; if($page->template == "xyz"){ $event->return = "<i>your markup for this page</i>"; } } $options = array("item_tpl" => "{itemCode}"); $nav->render($options); This way you don't need to hook module.
  2. As far as creating your own RSS list with PHP, I think there tons of examples out there if you search google. There's even one in this thread on first page! http://processwire.com/talk/topic/105-rss-feed-module/?p=6701
  3. RSS styling, also maybe read the Post Ryan made 3 posts above yours in here: http://processwire.com/talk/topic/105-rss-feed-module/?p=37799
  4. As if I could know you are not capable of doing things that require some coding when doing things that are not covered by ProcessWire. As for your question above, I really don't know as I don't understand how a RSS feed is getting sent? I usually serve a RSS XML Feed url that people subscribe to so there seems to be no "send out"? But I see there's a TTL for the feed settings, which as far as I know is the interval a reader is meant to update the feed, but there's no "at that hour" setting in a RSS feed as little as I know. The RSS module supports XSL stylesheet as far as I know. But it doesn't support custom content for the description field. I have never done RSS feeds that are styled or contains more than the standard "description" text. I guess it depends on what readers are capable of, similar to Newsletters. I usually try to avoid it, so I can't help there. https://www.google.ch/#q=formatting+rss+feeds As far as Custom content goes there could be a simple trick to feed the RSS module description "itemDescriptionField" (default "summary") field used with custom content. Before the RSS creation code in the template, you could define a local hook to add a new custom property to Page. // hook to add new property to pages, this makes $page->customDescription return some formatted code; wire()->addHookProperty("Page::customDescription", null, "customDescription"); function customDescription($event){ $page = $event->object; $event->return = "<h1>$page->title</h1><p class='lead'>$page->summary</p><img src='{$page->image->url}'>"; } // RSS generation using the above customDescription "field" $feed = $modules->MarkupRSS; $limit = 20; $articles = $pages->find("template=post, sort=-date_published, limit=$limit"); $feed->itemDescriptionField = "customDescription";$feed->render($articles);
  5. So you're using ProcessWire Admin login for frontend login? ProcessLogin is only meant for backend login, and it has only a GET id for editing pages. So the id (if set with ?id=1231) will get appended to the form action url. This will be looked for and redirect to the edit screen after login. ProcessLogin::afterLoginRedirect is hookable, so you could replace it depending on what user logs in. After all since it looks like a front end login you should consider creating your own login form, where you have full control and don't let everybody see where your backend login is.
  6. That looks like a permission issue with FTP and Apache/PHP user. As soon as you delete it PHP will create a new cache file and thus is again the owner.
  7. RSS is not meant for unpublished pages! #157 foreach($this->feedPages as $page) { if(!$page->viewable()) continue; $out .= $this->renderItem($page); } Why not just simply create your own xml list? Or copy the RSS module to your site/modules and rename/modify it to your need.
  8. That's a strange one. But There's anyway a couple strange things when using PW search with selectors sometimes. On my new blog http://soma.urlich.ch this doesn't happen and I have the same code. When I search for & it get's transformed to "&" and it finds results that contain no visible "&". On all other PW sites there's an error. On processwire.com if you enter "test&" you get some results and the first search entry " iPhone test is strange as it is a page that isn't viewable! Anyway, searching with like "some & string" isn't a problem, and maybe just a min char count test on the search form could easily prevent error for things like "&".
  9. No I mean the code for prev next by teppo, not the one I wrote cause that's different thing. if ($input->pageNum) { $limit = 15; // whatever limit you're actually using if ($input->pageNum > 1) { echo "<link rel='prev' href='{$page->url}{$config->pageNumUrlPrefix}".($input->pageNum-1)."' />"; } if ($input->pageNum * $limit < $items->getTotal()) { echo "<link rel='next' href='{$page->url}{$config->pageNumUrlPrefix}".($input->pageNum+1)."' />"; } } Or $limit = 12; // the "limit"-setting used on this page $children = $page->children("limit=" . $limit); $totalpages = ceil($children->getTotal() / $limit); // PAGINATOR: set SEO tags for Google if ($input->pageNum) { if ($input->pageNum < $totalpages) { echo "<link rel='next' href='" . $page->url . $config->pageNumUrlPrefix . ($input->pageNum + 1) . "' />"; } if ($input->pageNum > 1) { echo "<link rel='prev' href='" . $page->url . $config->pageNumUrlPrefix . ($input->pageNum - 1) . "' />"; } } I don't think modifiying the pager module is good or easy, as you're saying your not a coder even less. And pager module doesn't allow to do what you need. But with some custom code in template you can more easily generate a next link based on the pageNum etc. Maybe someone can help you getting the logic from the above script to what you exactly need.
  10. You might want to look into that thread http://processwire.com/talk/topic/5145-paginator-and-seo/
  11. With some help you could get it for less. $drinks->get("category=whisky, type=middletons, ice=1"); I like that ass.
  12. Would be great to know what PW version, cause I think this was already fixed long time ago? Edit: doesn't look like, but I don't know what's about it cause there seems to be some 0 ignore in PW with textfields, if you enter 000 it doesn't get saved.
  13. Yeah I'm also here.
  14. It's the nature of Radios in HTML, I've never seen or needed a radio group options to be unselectable. Maybe I'm wrong. Edit: Maybe I've misunderstood your post, ignore me.
  15. I'm not sure and don't have time to test, but the behavior seems correct. All 2th level are affected of course. I think you would want to define a selector for the parent only using "nav_selector" https://github.com/somatonic/MarkupSimpleNavigation#added-support-for-nav_selector-propertyfield-and-selector_leveln-new-in-121 So you could define the selector on the parent "Employees" $pages->get("/employees/")->nav_selector = "employee=1";
  16. Radios aren't made for deselecting, You may use ASM select then?
  17. Does it work without MSN? Usually employee=1 or 0 should work.
  18. Sublime Text 3 update: "Added image preview when opening images." Cool! #sublimetext

  19. Yeah I think the only way (dirty) is to use GET parameter added to each language switch with the language name, so you can know user has switched. I have hard time understanding why you need this kinda weird complex setup and not let the url speak. As I see you use LanguageSupportPageNames... I guess you then use no lang segment set on homepage names? There is this behavior of the default system language when those are set that redirects you to the root url if you enter domain.com/en/ when en is the default. It's kinda hard with this way of doing it, and I'm not sure what the best setup would be as there are so many variations and ways to do a ML setup. I just remember having such session and lang url params projects that was hard to figure out what's happening when something didn't work out or got broken. Too complicated for my simple mind really
  20. As far as I see it's only image/file and maybe page fields that need a page to be existent for custom php code in the settings. If you only use text fields it would be possible what you want. Otherwise you could still create a page with a unique name and redirect to the page edit screen for editing. Something like Pete was doing that was linked to in the thread I linked to.
  21. Damn martijn spamming my links
  22. AWStats just reads the access log from the server, so I'm not sure what your free server has or allows. You'd need access to the access log. There's no such script that can just be uploaded and tracks files downloaded. Unless you use this technique I mention with google analytics event tracking using JS. Or if you make a download file "is a page", so you can count on the template side with php. martijn was faster...
  23. I'm really wondering why this hasn't come up yet. I think it's not a very urgent problem, and for us advanced user anyway not. But for clients there's a chance that they get caught by it, so I think it should be prevented. What I'm talking about is, if you create a new page, enter title and hit enter two times fast, or double click save button. It will save page and try to create a second one, and fail saying there's already existing one with same name.
  24. To not write all over again: http://processwire.com/talk/topic/2696-check-the-template-of-the-page-which-will-be-added/ from two days ago, still fresh... Also it's not possible to edit page directly without saving it first, as some fields require a page ID to function, and that's why there's a page creation screen.
×
×
  • Create New...