Jump to content

gmclelland

Members
  • Content Count

    493
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by gmclelland

  1. From the video, it looks like you have uBlock origin enabled. Try disabling it for that site and see if that fixes the issue.
  2. Well I was trying to say if the new page is not a calendar-posting or a community-event then return. But I guess I have my operators wrong? && seems to work. Thanks rick - from a fellow Texan!
  3. For some reason it doesn't fire if I include the following in the hook: if($page->template != 'calendar-posting' || $page->template != 'community-event') return; or if(($page->template != 'calendar-posting') || ($page->template != 'community-event')) return; It does work for: if($page->template != 'calendar-posting') return; Any idea why that is?
  4. Got it working now. Thanks Robin for the reply and the debugging tips!
  5. Hmm... @Robin S I tried your hook in my site/ready.php, but it doesn't appear to do anything. The page name/url stays the same. I do see the hook displayed in the Tracy Debugger. Any thoughts as to why it might not be working? I also tried changing: $page = $event->arguments(0); to $page = $event->arguments[0]; but it didn't seem to make a difference.
  6. Here's where it talks about the site/ready.php file https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/ I think I remember why I chose not to use id based urls. I was worried it might be hard to import/export pages because the ids on the other site/system you are migrating to might be different. I think that's why I chose to use the built in behavior of Processwire. In my case duplicate page names don't happen very often. I would like to hear other people's opinion on urls that contain a page id.
  7. ...updated the blog_post template prepending _ready.php .... You shouldn't need to prepend the file. I believe site/ready.php gets picked up automatically. To fix your other blog posts, just re-save them and the hook should execute and correct the page name with the correct format. If there's a bunch of posts to go through, you could use Adrian's admin actions module http://modules.processwire.com/modules/process-admin-actions/ or the process wire API to loop through and re-save the pages.
  8. That's why I created a posted_on datetime field. I manually entered the date and time into that field since it may be different than time the post was published in Processwire.
  9. On my "news" template I have a datetime field for "published_on" that I use in the parent's template(news-index) "Sort settings for children" (reversed sort is checked). I'm pretty sure the sorting works for news items posted on the same day.
  10. Your welcome. I'm still learning too! Looks like it generates and assigns a random id here https://github.com/processwire/processwire/blob/6241fd67300c456c225cb336a3de27acab167b2d/wire/core/PagesEditor.php#L343 until the page is saved. Probably to make sure the page name is unique? Pages are stored in the "pages" table. The field data is stored in each field_fieldname table. Each field gets it's own database table.
  11. Hrmm... I tried it on a site and couldn't get it to work. You might need to go the module or hook in your ready.php route. I also don't think you are seeing the correct id of the new page. We are probably seeing a temp page id, since the page hasn't been created yet. On a past site, I choose to simply not worry about the page name. When a new page is created and the name is not unique, an incrementing number will be appended to the end of it until it is unique. To make it easier to view the news postings in the page tree, I edited the template's under the "Advanced" tab > "List of fields to display in the admin Page List" setting to include the date. Someone else may chime with some other better ideas.
  12. Try it like this "$id $title" without quotes. A dash will probably automatically replace the space character.
  13. It's in the second screenshot with the Blog template. It's collapsed.
  14. If that doesn't work you may need the module from here. There's also a list of forum discussion that mention how to do it with a hook.
  15. Edit the Parent template and look under the "Family" tab and you'll see the "Name format for children" Try entering "id-title" without quotes in that field and see if it works. As described on http://processwire.com/api/modules/process-template/ You might also need http://modules.processwire.com/modules/page-rename-options/ Hope that helps
  16. You could use Cloudflare.com's DNS and set a Page Rule to set the security level to "High" for your admin url. I've never had much luck blocking IP addresses.
  17. @nabo For multilingual url fields maybe you could try this module with https://github.com/ryancramerdesign/FieldtypeURLLanguage? Sorry @anyway, I'm not sure. Maybe you can list the permission of the user's roles? Does the user's role have the page-edit permission? Did you enable access control for the field? Edit the field and click on the "Access" tab to check.
  18. Thinking about it some more... As an alternative to "Single Child", you could also use "One per parent"
  19. Seems like a good enhancement. The examples you provided were well thought out.
  20. Thanks for providing the site profile! Just wanted to let others know I had to do the following to login. Add this to the startpage.php in the site/templates/ directory $admin = $users->get('admin'); $admin->setOutputFormatting(false); $admin->pass = 'herewegocheckitout22'; // put in your new password $admin->save(); Then visit the homepage to execute the code. Then remove the same code from the template. Then login to yoursite.com/processwire/ not yoursite.com/wire/ Hope that helps others
  21. FYI... There is also a discussion around focal point image cropping https://github.com/processwire/processwire-requests/issues/150 if anyone is interested.
  22. I know this old, but the answer to this question is to add: $accept->attr('data-href', wire('config')->urls->admin . 'page/edit/?id=1479'); Remove this line: $accept->attr('href', 'http://localhost/winkelmann/www/bewerbertool-talents/admin/page/edit/?id=1479'); Hope that helps the next person.
  23. @flydev - I have ran into the same issues with my sites that use TemplateEngineFactory with TWIG. I had to do the following: $session->redirect($pages->get($config->http404PageID)->httpurl()); throw new Wire404Exception(); Maybe you could post something in the TemplateEngineFactory topic? Maybe @Wanze would know of a fix?
  24. @louisstephens Those content sections are just rendered with a foreach loop like: foreach($page->test_matrix as $item) { if($item->type == 'blockquote') { echo " <blockquote> <p>$item->quote</p> <cite>$item->quote_cite</cite> </blockquote> "; } else if($item->type == 'bodycopy') { echo " <h2>$item->title</h2> $item->body "; } else if($item->type == 'gallery') { // and so on... } } That code was taken from http://processwire.com/api/modules/profields/repeater-matrix/ So when a user changes the order, it will automatically be displayed in that order on the frontend.
  25. Well it definitely can be done. See https://processwire.com/blog/posts/amazon-aws-now-powering-processwire.com-sites/ I've had good success with running sites on a $10/month 2GB Linode VPS and https://serverpilot.io/ $10/month per server.
×
×
  • Create New...