Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by snobjorn

  1. Perhaps it is ACF and / or HTML Purifier. They are both turned on. I tried adding this, with no luck: ol[reversed]
  2. I am trying to get the following to work in CKEditor (inline editor): <ol reversed> With no luck. Other options, like the one below seems to work. But the reversed is stripped from the text. <ol start="50"> Anyone tried reversed, and got some pointers?
  3. As a follow up question to the first paragraphy solutions provided. Is there a way to get "the rest of the text" output? A way to exclude the first paragraph? The result I am looking for is to output the first paragraph from a body text field, then an image from an image field, and then the rest of the text from the body text field. So there might be other solutions?
  4. Has anyone worked with ProcessWire and Google My Business API on getting (blog) posts published to a business Knowledge Panel? I wonder if there is an "easy" way to set this up in a ProcessWire page template. Source: https://developers.google.com/my-business/content/posts-data
  5. I have previously been using uppercase URL in $page->image->URL for browser cache busting query string purpose. Is this compatible with MarkupSrcSet? My current image url is $page->image->srcset('860x0,/2,/3').
  6. I got the following error in my error logs, and am trying to find the source of error. Has anyone experienced this error before? guest /http404/ Error: Exception: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '41-0' for key 'PRIMARY' (in /home/vidnokts/public_html/wire/core/FieldtypeMulti.php line 295)
  7. VID (https://www.vid.no/) is searching for a Norwegian-speaking developer for development of all kinds: Updates, tweaks, possible major updates, as an adviser, and more. There are no concrete plans for new big projects as of this moment, but we're always taking our website a step further. So development of any size could and will arise. It is therefore important that you are open for development of all kinds. Some facts: We use GitHub. We stay updated with latest version of core and modules. We are fans of UIkit. We are interested in new ideas, more effective ways to work and think details are important. Send a message if you are interested. Got some projects you are proud of? Send us a link in your message as well!
  8. I'd like to see HTML5 attributes for hyperlinks, such as download, media and ping, when editing links in ProcessWire (with CKEditor) . Download is the one I'm using myself, but I'm mentioning the other ones as well. More information at New HTML5 Attributes for Hyperlinks: download, media, and ping.
  9. This will be a one-way sync (as I mentioned in my second post in this thread). The data will only be updated in the Directus database. No editing on these data will be done in ProcessWire. Also said, but in other words: When the data is imported (to ProcessWire) and kept updated/synced, I will be able to use the ProcessWire API to handle the data as per today. Meaning no extensive recoding of templates and so.
  10. I still have the need for ProcessWire to create a page for each item in Directus database. And be able to update the title if the item changes. And also I would prefer to keep working with the ProcessWire API, because of the way the end point for this import («person pages») is integrated with the rest of the website.
  11. The one-off task was rather easy, and I have managed this using the php sdk as you mention. But I'm not sure about how to go further, setting up a continuous synchronization. One-way, from Directus to ProcessWire. I'm new to this way of thinking (working with APIs). Should I use «cron jobs» of some sort? Or rely on Directus «pushing» when something is updated? Any good ideas are welcomed. Maybe this post could also be a heads up to others who are new to this …
  12. Has anyone integrated Directus with ProcessWire? I have a database in Directus that I want to sync with ProcessWire (create/update/delete pages). But I don't not know where to start. It might be possible with ProcessWire's API in some way?
  13. I've only ever seen ?s=1 back-end when saving before, not front-end when clicking Save + View.
  14. When clicking on Save + View , the system adds ?s=1&c=0 on the end of the URL. Is that related to some changes in 3.0.60?
  15. Thank you, @abdus, your solution worked. So it buys me some time to figure out what happened with my initial setup.
  16. I have a webpage that I (think have) worked well with translation of dates based on a setlocale() code in a _init.php file until now. The page is in Norwegian (default) and English (english). But the date shown front end is now only in English. I have a multi-language textfield (locale) where I input nb_NO and en_US, and then I use the follow code in _init.php: $homepage = $pages->get('/'); // For change of language, set default language switch($user->language->name) { case 'default': setlocale (LC_ALL, $homepage->locale); break; } To check what is output, I used this: echo setlocale(LC_ALL, 0); And it only outputs C both on the Norwegian and English page. (It should output nb_NO and en_US). I have the same setup on another page, at least I think so, but something must be different. I also tried changing the locale, and editing LanguageSupport.module, removing the setlocale() code from above, with no luck. I check both in development (MAMP) and on my production server. I use ProcessWire 3.0.59 (live) and 3.0.60 (development). There could be other code I have that messes this up. But I hope this could shine som light. My question is: What decides the locale and how could I fix the «C»?
  17. A couple of days ago my site went down for about 3–4 hours, due to what Cpanal calls EPf faults. There was over 300.000+ faults in total over the span of a few hours, resulting in a 508 error. I talked to my shared host support, which did not say anything about attacks or high traffic (this is a low traffic site on a decent shared host solution). But they said that the problem was the .htaccess file. Thing is, I've been using the same .htaccess file for months. Being said, I updated the file to a «out of the box» ProcessWire file with a few uncomments, and htaccess files from other installations of mine, but it did not seem to work stopping the 508. I ended up with a htaccess file from another installation, with the ProCache code implemented. And just when I removed that part, the page started working again. It might be coincidental, that it was just some processes that stopped or services that restartet. I don't know. What I do know is that ProCache was mostly turned off on my templates, which I have later turned on. All in all, I don't exactly know what the problem was, or what the solution could be. I'm hoping ProCache will work. If it even could help solve such a problem. What I am actually asking is, have anybody else had this problem? (Attacks, bad coding, cache turned off …?) Could ProDevTools shine a light on the issue if the webpage shows 508 due to a high number of faults? (Sorry for the messy post by the way, a lot of unstructured thoughts.)
  18. Here is my solution for large sitemaps containing thousands upon thousands of pages, without the trouble of timeouts and such. I'm currently running this on website with 170.000+ pages. Relying only upon the ProcessWire API. Just a sidenote: I have no actual need to add all my pages to a sitemap … The keywords here are sitemap index, sitemap and ProcessWire's page numbers. Two templates: sitemap-index.php sitemap-xml.php (with page numbers activated) The structure of mine is this: sitemap-index.php is domain.com/sitemap/ sitemap-xml.php is domain.com/sitemap/sitemap/ And the code for each of them: sitemap-index.php <?php namespace ProcessWire; $out = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $templates = "basic-page|blog-post|tag"; $key = $pages->count("template=$templates"); $limit = 200; $pageNum = ceil($key/ $limit); $post = $pages->get("template=sitemap-xml"); $i = 1; while($pageNum >= $i){ $out .= "\n<sitemap>" . "\n\t<loc>" . $post->httpUrl . "page$i/</loc>" . "\n\t<lastmod>" . date("Y-m-d", $post->modified) . "</lastmod>" . "\n</sitemap>"; $i = $i + 1; } $out .= "\n</sitemapindex>"; header("Content-Type: text/xml"); echo $out; ?> sitemap-xml.php <?php namespace ProcessWire; $out = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $pageArray = $pages->find("template=basic-page|blog-post|tag, limit=200"); foreach ($pageArray as $post) { $out .= "\n<url>" . "\n\t<loc>" . $post->httpUrl . "</loc>" . "\n\t<lastmod>" . date("Y-m-d", $post->modified) . "</lastmod>" . "\n</url>"; } $out .= "\n</urlset>"; header("Content-Type: text/xml"); echo $out; ?>
  19. Now that Google is closing down the paid service Google Site Search, and only the free ad version of their search will be available within a year, I have started looking around. It seems that DuckDuckGo has an API that delivers data as JSON. Has anyone used this with ProcessWire and have some code and guidance to offer? Such as listing the results, open for pagination and any other tricks?
  20. Is there a way to append $rss->itemLinkField = ''; ? For use with campaign url or other tracking methods. E.g. such as this: $rss->itemLinkField = 'httpUrl' . '?utm_source=RSS_Feed&utm_medium=RSS&utm_campaign=RSS_Syndication'; Except that this wont work … I have also tried: $rss->itemLinkField = 'httpUrl'; $rss->itemLinkField .= '?utm_source=RSS_Feed&utm_medium=RSS&utm_campaign=RSS_Syndication'; Just to show what is not working, and what I am trying to achieve.
  21. I have been trying to tweak the example from the blog post about repeater depth to work with a two level repeater. Where each "first level" should indicate the start of a Bootstrap column (e.g. col-md-4). And the last item of each "second level" should indicate the end of the previously "opened" column. Examples: Repeater input: Repeater level 0 - Repeater level 1 - Repeater level 1 Repeater level 0 - Repeater level 1 - Repeater level 1 Output example: <div class=col-md-4> <h2>Repeater level 0</h2> <p>Repeater level 1</p> <p>Repeater level 1</p> </div> <div class=col-md-4> <h2>Repeater level 0</h2> <p>Repeater level 1</p> <p>Repeater level 1</p> </div> Even though I could imagine other solutions to this exact problem, the code would be helpful because of the whole detecting and closing opened <div> tag based on level. How would one approach such a problem?
  22. Thank you for your suggestions. I see now that there are methods that could work with fewer pages, so I have added some additional information in my initial post. I should have mentioned this in my question: I have over 170 000 pages to check. It seems either method suggested is too much to handle.
  23. I have a web page where all templates have Norwegian (default language) and English (secondary language, ID 1036). Many of my pages have been imported using the API, and so I used a method from How to set language = active via API? to set the secondary language active. Now I want to output a list of pages where the secondary language is inactive. I have tried the following without luck: $pages->find("template=basic-page, status1036=0") But this gives an error: Field does not exist: status1036 Is there another way that makes this possible? Additional information: basic-page was just an example, I should have been more clear from the beginning. I have multiple templates and a totalt of 170 000 pages to check.
  24. This is great. I was just looking for a way to nest repeaters a few weeks ago for a three level menu. My result was messy. But now I was able to do it better, with more options, easier editing and less code. Thank you for the time you are putting in to create this! I can see some future possibilities: Such as where the nesting depth level defines the width of repeater matrix items on the front end. Making it possible to create a dynamic template where each item can have a different column widths (Uikit or Bootstrap). It would eliminate the need to set the width as a value (or page field value). Making the back end a little more visual (good for the overview). Perhaps with flexbox in css on the front end …
  • Create New...