Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


gebeer last won the day on February 18 2020

gebeer had the most liked content!

Community Reputation

1,120 Excellent

1 Follower

About gebeer

  • Rank
    Distinguished Member

Profile Information

  • Gender
  • Location

Recent Profile Visitors

10,429 profile views
  1. In your code you are storing an array $portfolio to the cache. To store HTML you would use the same logic as for storing an array but store an HTML string instead. How you create the HTML string is totally up to you. It could be the return value of a $page->render() call or anything else. Simplified example $response = $cache->get('my-html-cache'); if (!$response) { $html = $page->render(); // render a page // OR $html = $files->render('path-to-template.php'); // render page data with a custom template file // OR $html = '<h1>Cached Headline</h1>
  2. A GET parameter is the way to go here, as @rash suggests. You could also use the template name in the get parameter <p><a href="<?= $item->url ?>?template=news-detail">read more</a></p> and then in your news.php template do something like if($input->get->template && $template = $input->get->text('template')) { // check for GET parameter 'template' and sanitize $files->include("{$template}.php") // use $files API to include the template. All API variables (like $page) will be passed } else { // your regular news.php tem
  3. Wouldn't it be better to avoid commas in URLs? According to the URI RFC, commas are reserved characters. They are allowed for filenames in URLs. I haven't tried it, but you should be able to configure conversion of comma to dash (or other characters) in module InputfieldPageName to avoid them in the first place. Configurable option for convertEncoded in the InputfieldURL module also seems hacky to me.
  4. I took @bcartier's code from this post and made a configurable module from it. You can find the module attached. I can confirm that the redirection to a non-default language works on PW 3.0.172 DefaultFrontendLanguage.zip
  5. @fedeb what software did you use to create the performance graphs?
  6. My repeater field's name is 'repeater'. So the template name of pages that this repeater creates in the background is 'repeater_repeater'. If my repeater field was named 'myrepeaterfield' then the template would be 'repeater_myrepeaterfield'. Repeater fields create one page for each repeater entry to store the data. Those pages are located in the page tree under Admin->Repeaters. In my case it looks like If you edit one of those pages, you can see the template name that PW creates automatically
  7. @Bike already put you on the right track. I have an example setup that does just this: pull values from a repeater field and display them in a select dropdown. Here's how I made it work. 1. have a repeater field called 'repeater' on a template. The repeater field can have as many fields on it as you like. Mine only has one field named 'headline' 2. make some entries to that field 3. setup a page reference field, mine is named 'selectfromrepeater'. It has Single Page selected in Details tab. In the Input tab, I have following settings See the Label field? Here I ha
  8. A workaround is defining the type in an @var comment like /** @var ProcessWire\MarkupAdminDataTable $table */ $table = $this->modules->get("MarkupAdminDataTable"); $table->headerRow($header); This will give you nice type hinting
  9. Almost 2 years later and I am trying to tackle the same problem. $config->adminThumbOptions is still being referenced in https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldImage/InputfieldImage.module In https://github.com/processwire/processwire/blob/d8945198f4a6a60dab23bd0462e8a6285369dcb9/wire/config.php#L755 it says width and height are deprecated in favor of gridSize. So it seems we cannot set a default admin thumb size anymore with width and height. BUT something weird is happening in a 3.0.65 install when I add this to config.php
  10. I was just about to ask for a release date, too :-) Seems I'm not the only one who is keen on getting their hands on this. As I understand it, this will be released as a paid module which is only fair. @flydev 👊🏻 mentioned that he wants to get the promoting website up and running before selling the module. Just in case that this is slowing things down, I would even be happy to pay for a pre-release version.
  11. Thank you for this module! It was not working for me until I found out that the HTML created by CKEditor was something like <p style="margin-left:0cm; margin-right:0cm">https://www.youtube.com/watch?v=Lh63JcccM7k</p> So the <p> tag has a style attribute. The regex (line 180 in module php) does not cater for that. $regex = '#<p>\s*(https?://(?:www\.)?youtu(?:.be|be.com)+/(?:watch/?\?v=|v/)?([^\s&<\'"]+))(&[-_,.=&;a-zA-Z0-9]*)?.*?</p>#'; I adjusted it, so that it also works for paragraphs with attributes $regex = '#<p.*>\
  12. Glad that this is still useful for you. In the meantime there have been quite a few posts about this topic and there is a great module out there that can assist in building REST APIs with ProcessWire: https://processwire.com/modules/rest-api/
  13. Here is one possible way to go about this: add the user role and template name to the ProcessWire.config JS object with https://processwire.com/api/ref/config/js/ in /site/modules/InputfieldCKEditor/config.js retrieve that information and setup different CKEditor configs depending on role/template
  14. You can load all the CKEditor assets in a template by loading the module $modules->get('InputfieldCKEditor'); This will load all assets to $config->scripts and $config->styles Now in your main.php (or template file that renders your <head>) you need to include something like foreach ($config->styles as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />\n"; foreach ($config->scripts as $file) echo "\n\t<script src='$file'></script>\n"; This approach is only working with the delayed output strategy.
  • Create New...