Jump to content

mjut

Members
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    1

mjut last won the day on September 26 2023

mjut had the most liked content!

Recent Profile Visitors

1,347 profile views

mjut's Achievements

Jr. Member

Jr. Member (3/6)

17

Reputation

  1. Nice qtguru! I never really looked into twig. I am curious now. 😉
  2. Here is the script: #!/usr/bin/php <?php namespace ProcessWire; include("/home/stephan/www/index.php"); foreach ($pages->find("template=post, status=unpublished, sort=unpublished, limit=1") as $post) { $post->removeStatus('unpublished'); $post->addStatus('published'); $post->save(); } With cron it is triggered once a day and it will look for unpublished posts. If there are any, the oldest post will get published. Simple as that. I am using this script to update my photo blog https://photos.stephansimonis.com more regularly. 😉
  3. Hi forum, I don't really know how to do this: I want to create multiple (not published but saved) pages. From that on, I want the pages to be published each page a day aromatically. I am sure, this is possible.. But where do I begin? Thanks for suggestions and input. Cheers Stephan
  4. mjut

    Appreciation

    Oh yes! I remember that one!
  5. Alright. It wasn't a MySQL-issue at all! In my search-template I've been using the selector fields incorrectly. I wanted a page-referenece field to be searched and listed. in the selectors I called "pagereference" what I need to do was putting "pagereference.title" into the selectors! Without putting *title after the field, the results were based on searching the url. That led to results I wasnt expecting...
  6. mjut

    Appreciation

    I did revised and recoded my personal blog (journal). It is running with Processwire smoothly since years. A decade ago I started that journal using Textpattern.. So I thought, hey, why not putting it back to Textpattern? I still have a lot of sympathy to Textpattern. Probably because it is the system I learned on.. After setting it all up – it made me giggle every time when I remembered how to do, and work around things – I was happy with the result. After this little travel back in time, I deleted Textpattern again to keep on using Processwire. Nothing else to say. Why am I posting this little story? I dont know... But this might be the right place where people understand what I am saying.. ;) Thanks a lot!
  7. Perfect! Works as it is supposed to do. I just installed the module on my online journal / blog. Keep in mind: encrypted fields are not searchable anymore.
  8. I am experiencing the same issue – changing the collation did not fix it. But maybe it is something different? When searching for Lüneburg the word is being found in all body-fields (textarea) but not in title-fields (the system generated text field). Replacing the Ü with U, I'll get the desired results. Here comes the weird behavior: When searching vor üneburg (umlaut it the beginning of the word) all results with "Lüneburg" in the title-field are being found and listed!!! Isnt that weird? I did look into the database: all tables are set to utf8_general_ci. Changing them to utf8_unicode_ci or even utf8mb4_unicode_ci did not change a thing. I am not sure, where to look into next?
  9. I just used this today – very handy. I specified a template too: wire()->addHookBefore('Page::addable', null, function ($e) { if ($e->object->parents("template=basic-page")->count > 1) $e->object->template->noChildren = 1; });
  10. @Zeka Thank you tons! Yet again, it amazes me how simple Processwire is. I went for the owner selector. Sorry, I did not know about this. The functional code looks like this: <ul> <?php $tags = $pages->find("template=tag, tags.owner.template=post, sort=title"); foreach ($tags as $tag) { ?> <li><a href="<?php echo $tag->url ?>"><?php echo $tag->title ?></a></li> <?php } ?> </ul> As simple as that. I looked it up in the docs, but did not find it – but there is a blog post about Owner Selectors: https://processwire.com/blog/posts/processwire-3.0.95-core-updates/
  11. I am building a web site with a blog / posts section. With each post I create I can add tags. That is happening with a page reference field. For each new tag a new tag (page) will be created. On an "archive" page, I want to list all tags with this code: <ul> <?php $tags = $pages->find("template=tag, sort=title"); foreach ($tags as $tag) { ?> <li><a href="<?php echo $tag->url ?>"><?php echo $tag->title ?></a></li> <?php } ?> </ul> Simple as that, it works as expected. All tags used anywhere in my posts are listed. (yaaay!) But: When creating a new post without publishing, new tags be created and will listed on my archives pages. How can I modify my code to exclude all tags that are associated with unpublished posts? Cheers Stephan
  12. Oh, I wasnt aware, that there's a module. I am sure, this will lead me to a solution. Thanks a lot, this is very helpful!
  13. @dragan thank you for answering! I 100% agree with everything you wrote. (including the multiple posting. that was due to me searching the forum and collectiong information). Usually, I don't need a differnt way of handling a multi-lang site. The processwire way just works and is fine and is straight forward for me. This project I am working on is different. Processwire is providing and delivering the content. But there wont be any UX and no navigation. We will have lots of texts in the museum, each text is accompanied by a QR-Code for the translation into 2–3 languages. (so, QR-Codes all over the museum) The visitors need to scan a QR-Code to get to the specific page containing the translation. To clarify this procedure, I can think of two versions to achieve this. The first one is the usual processwire-way (like in the provided multi-lang-profile). The second one is my desired one, that I need help with. 1. simple solution for each language, there will be one QR-Code (each text in the musuem is accompanied with multiple QR-Codes to choose from) the Visitor scans one of them and the language specific url will be opened conclusion: Each text needs more QR-Codes … one for each language. Thats ugly, and if there will be more language later on, I’d need to add even more QR-Codes… 2. wanted solution there will be only one QR-Code to scan for the visitors, no matter what language - thats much nicer than several QR-Codes the visitor scans that one QR-Code, and will be send to the default language. there will be a lnaguage-switch. So, the visitor can set the desired language. the visitor scans the QR-Code for the next text, the visitor will be directed to the previously set language. (without need to set the language switch again) - if there will be the need to add more languages later on, I can add these in processwire without managing more QR-Codes I hope, this explains the whole project… ? @dragan I like both of your suggestions – the detection of the browsers language and the cookie storage. I did look into the API to set a cookie (session storage?) but I did not understand the techniques described there. No luck for me there… I am going to look into the browser-language detection now. Cheers Stephan
  14. I think, I have the similar question: I need the language-settings being stored into the (guest-)users session. The reason is, the URLs will be openend via an QR-Code. I want the same QR-Codes leading to the (previewsly) selected language by the user. Simply put: 1. the user openes one page via QR-Code. The language can be switched to the desired language. 2. whenever the user openes another page via a different QR-Code, I want processwire to remember the language settings. (depended on each user) does this make any sense? or should i explain that in detail? I already did create a question over here: https://processwire.com/talk/topic/23299-one-url-for-multiple-languages/ Thanks for your help!!!! Cheers Stephan
×
×
  • Create New...