Jump to content

dragan

Members
  • Posts

    2,007
  • Joined

  • Last visited

  • Days Won

    21

Everything posted by dragan

  1. @yrglx check out the docs: https://processwire.com/docs/security/file-permissions/#securing-your-site-config.php-file
  2. Just tag your images. https://processwire.com/blog/posts/processwire-updates-and-new-field-types/
  3. I'm not sure I understand your setup. e.g. why don't you use a separate parent and template for tags? Do you have any settings in your parent templates that say "only pages with template x are allowed as children"? "extra template" = additional template? I guess the system is confused because you allow two templates for selecting, and is not sure where to create new pages. afaik there's no additional settings where you could define that. You'd probably have to create a hook for that.
  4. Just stumbled over this yesterday, when I wanted to do a simple date-difference calculation...
  5. Page names have to be unique (if they share the same parent). If you create a new page with an already existing page-name, PW will append an integer. If you clone a page, it will add " (copy)" to the title, and also an auto-increment number to the page name. This happens both when you use the API or GUI. Maybe that's the problem here? You could check with slightly altering the selector for page name: name%= instead of name=
  6. Nope, nothing like that. I never understood that nonsense with hardcoding full URLs into the DB. You might adjust a few lines in your site/config.php (allowed domains whitelist, disable debug-mode, change DB-credentials etc.), but that's about it.
  7. No. In your Iron Maiden test gallery you load 4 JS files. You don't load them in your gallery you referred to in your first post. Check your template setup, your include/require setup etc. and make sure all frontend assets (css/js) are being loaded in your page(s).
  8. When I inspect your page, no JS is being loaded at all. This doesn't have to do with PW per se. You're responsible for handling all the frontend assets correctly. (when I say "you", I mean the site-developer. The CMS just delivers what you tell it to.) Go back to the drawing board and make sure your HTML, CSS + JS setup is correct. Perhaps there's a missing include() or you've disabled a prepend or append .php file?
  9. How is your API setup? Do you have this one single endpoint to retrieve everything? You could allow URL segments in your home (root) template (if you need just one, define only one and name it "api"). Then you would have to include some logic in your home.php template to handle the API requests. if($input->urlSegment1 == 'api') { // ... } else { // regular display of homepage } https://processwire.com/docs/front-end/how-to-use-url-segments/
  10. https://stackoverflow.com/a/36373890
  11. You could also get such a list with a few lines in the Tracy Debugger console, e.g. $pgs = $pages->find("template=project|basic-page|offer-index, parent!=2, include=all, sort=parent, sort=title"); foreach($pgs as $p) { echo "{$p->url}<br>"; } of course, adjust the selector as needed. If you need the full URL, just replace $p->url with $p->httpUrl
  12. Pixies live in Zurich, on their Doolittle tour: one of my all-time favorite gigs ever. God I'm old... ?
  13. https://www.npmjs.com/package/benny-hill !!! ??
  14. ^ does this look normal to you? I see the same dev-template twice o_O Sure, but I have no idea how to find / generate JSON settings. Is that done from within Tracy? Or Tracy's module config @ module/edit?name=TracyDebugger&collapse_info=1 ? Template settings: I assume the JSON export from backend/setup/template/export/ ?
  15. I have defined an alternative tpl in the tpl settings, and I then use the Template Path panel in Tracy, where it says: (the three orange cubes icon)
  16. I'm not sure, but maybe you could look at https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldIcon/InputfieldIcon.module which is used in template settings under tab "advanced" and create something similar?
  17. I'm not sure I understand. Do you mean to not only create a new page and the default title, but also populate other fields of the same template? What kind of data would that be? ^ can you rephrase that? If you just hit enter, it will create a new page; that's an in-built functionality.
  18. Nice module! Thanks for sharing.
  19. I'm getting such errors increasingly with Tracy: Filename doesn't exist: /home/foocom/www/dev.mysite/site/assets/cache/TracyDebugger/offer-index-dev.php on line: 135 in /home/foocom/www/dev.mysite/wire/core/TemplateFile.php I then have to manually copy over my dev tpl to the Tracy cache folder. Is this a bug?
  20. I see some more files which are loaded in the backend:
  21. Just wanted to mention Migrator too as a possible alternative/tool. Make sure to read @adrian's first post carefully and the updated readme.
  22. I don't have much to add to previous feedback posted already here, except that delivering a suitable (physical) image variation is good practise. It impacts page speed performance and also affects mobile SEO ranking: https://webmasters.googleblog.com/2018/01/using-page-speed-in-mobile-search.html Even in 2019, not everyone has ultra high-speed internet access everywhere and all the time.
  23. You could use something like this: $refs = $pages->find("template=project, title%=Zürich, include=all, limit=3"); // limit here just for testing small result-sets $count = count($refs); $last = $count-1; $c = 0; echo "<p>$count</p>"; foreach($refs as $r) { switch (true) { case ($c === 0): echo "<hr><strong>FIRST: {$r->title}</strong><br>{$r->project_desc_short}"; break; case ($c === 1): echo "<hr><strong>SECOND: {$r->title}</strong><br>{$r->project_desc_short}"; break; case ($c === 2 && $c === $last): echo "<hr><strong>LAST: {$r->title}</strong><br>{$r->project_desc_short}"; break; case ($c === 2 && $c != $last): echo "<hr><strong>THIRD: {$r->title}</strong><br>{$r->project_desc_short}"; break; default: echo "<hr><strong>DEFAULT: {$r->title}</strong><br>{$r->project_desc_short}"; break; } $c++; } echo "<hr><br>" . $refs->count . " Referenzen gefunden"; see also https://www.phpknowhow.com/basics/if-else-and-switch-case/#highlighter_461554 Perhaps you could use this technique (PHP 7.2+), with goto: https://derickrethans.nl/php7.2-switch.html
×
×
  • Create New...