-
Posts
11,176 -
Joined
-
Last visited
-
Days Won
371
Everything posted by adrian
-
Bit me once again today :) In this case I did have that module installed, but even after disabling it, I still had issues with a particular template where I had specifically set noLang in the advanced template settings, so watch out for that.
-
I added this to my search.php template file. Hope that helps. $searchEngine->addHookAfter('Renderer::renderResult', function($event) { $p = $event->arguments[0]; $image = $p->getunFormatted('pdf_images|image|images|video_images')->first(); if($image) { $thumb = $image->size(0, 260, array('upscaling' => false)); $event->return = ' <div class="row"> <div class="small-12 medium-4 large-5 xlarge-4 xxlarge-3 columns teaser__image"> <a href="'.$p->url.'"> <img style="max-height: 300px" src = "'.$thumb->url.'" /> </a> </div> <div class="small-12 medium-8 large-7 xlarge-8 xxlarge-9 columns teaser__content"> ' . $event->return . ' </div>'; } });
-
Sorry about that - looks like I messed up the property name. I just tested though with "roles" and it's working here, eg: $options = array( "page_protected" => true, "children_protected" => true, "roles" => array("editor"), "message_override" => "My custom login message", "prohibited_message" => "My custom prohibited access message" ); $page->protect($options); I'll fix the documentation in a minute, but you you please try the above to confirm it's working for you.
-
@Macrura - thanks to @Robin S in another post: https://processwire.com/talk/topic/15902-hannacodedialog/?do=findComment&comment=208498 // add hanna code dialog to fields even though the Hanna code text formatter isn't applied // https://processwire.com/talk/topic/15902-hannacodedialog/?do=findComment&comment=208498 $this->wire()->addHookAfter('InputfieldCKEditor::renderReadyHook', function (HookEvent $event) { $inputfield = $event->object; $field = $inputfield->hasField; // For your field name(s)... if(!$field || $field->name !== 'XXXX') return; $config_name = "InputfieldCKEditor_{$field->name}"; $config_name_matrix = "InputfieldCKEditor_{$field->name}_matrix"; $config = $this->wire('config'); $js_config = $config->js(); foreach($js_config as $key => $value) { if($key === $config_name || strpos($key, $config_name_matrix) === 0) { $js_config[$key]['extraPlugins'] .= ',hannadropdown,hannadialog'; $config->js($key, $js_config[$key]); } } });
-
How to store all the submitted emails in one page and in a table ?
adrian replied to Norman_12's topic in General Support
Ah sorry, the way I read things, I thought he had already fixed the separator issue and still didn't like the column widths.- 42 replies
-
- contact page
- contact form
-
(and 1 more)
Tagged with:
-
How to store all the submitted emails in one page and in a table ?
adrian replied to Norman_12's topic in General Support
CSVs don't have widths. You are using Excel to view a CSV. If you want a properly formatted Excel file, it's pretty trivial to write an API script to export a series of pages to an Excel file with something like https://github.com/PHPOffice/PhpSpreadsheet which lets you format the spreadsheet almost however you want.- 42 replies
-
- 1
-
-
- contact page
- contact form
-
(and 1 more)
Tagged with:
-
How to store all the submitted emails in one page and in a table ?
adrian replied to Norman_12's topic in General Support
BCE comes with a comma in that option by default ?- 42 replies
-
- contact page
- contact form
-
(and 1 more)
Tagged with:
-
@pwfans - I wonder, do you have a copy of ListerPro? This might be a better option for your needs. It's inline editing isn't quite as convenient as BCE's, but it has pagination and searching and so it scales infinitely.
-
But how nice would that interface actually be for hundreds / thousands of pages? What sort of bulk edit actions are you referring to? Changing status, or deleting etc? I suppose there could be a way to select all across all pages if they were to be paginated. I'm afraid I just don't see it as the right tool for the job in this case, but if you want to add support for this, I'm happy to accept a PR.
-
@donatas - the only viable approach is to use teppo's add-on module: https://processwire.com/modules/admin-restrict-branch-select/ Any other approach would be a complete rewrite and would have other complications.
-
@pwfans - I always disable BCE for pages that have too many children for the edit mode to handle. I don't really think the edit mode makes much sense with that many pages anyway so I don't think pagination will help. If you need to batch edit that many child pages you probably need to write a script via the API (Tracy Console panel or AdminActions perhaps?) to make the changes.
-
There is also https://processwire.com/store/pro-dev-tools/user-activity/ so given that, I don't see anything like it ending up in the core.
-
@ryan - what about a dedicated "Skins" section - maybe within the modules directory. Perhaps the requirement for adding a skin to the directory would be to link to a Github repo with the admin.less and also an admin.png file which could be used on the skin's page in the directory. Ideally I think it would be nice if it was possible to view all skin screenshots via a gallery of thumbnails to make it easy to browse visually.
-
@Tom - I think the field=title within the quotes selector, vs having the list of fields in a separate quoted group is optional either way. The "array_values" is needed because the text tags needs the array to be indexed numerically starting at zero, rather than the page IDs which findRaw() returns.
-
@Pete - I'd like to second this - is it an easy fix to show the full message in the email? Thanks!
-
@fruid - I'll admit the database vs in-memory can be somewhat confusing in PW in terms of what selectors are support for one but not the other. This definitely needs improvement and better documentation, but I don't think that is really relevant in this case. Once you assign an array of pages to a variable and then do a find on that, you are using an in-memory selector - you're not querying the database anymore. This means if you are loading so many results that you need to paginate, then you're losing some of the benefits of pagination. This is not PW specific or even PHP specific. Regarding the two subsections - are you grouping results into these subsections? It's hard for me to advise on that without having an example of exactly what you are trying to do.
-
I can confirm that @matjazp's example works. The thing is though that this still means that you are loading all pages into memory and then paginating. This doesn't seem like a good idea in general - is there a reason you can't limit the find() to the results you want and just use my example which only loads the required pages for each page/view - much more efficient and scalable. What is the actual set of pages you are trying to query? Have you tried to build a selector that can get what you want with one find operation?
-
Thank you @bernhard and @ryan This is really brilliant and exactly the type of skinning ability that I think we've been missing!
-
Can you try this bare-bones example: $pager = $modules->get('MarkupPagerNav'); $items = $pages->find("id>0, limit=10"); // replace id>0 with your selector echo "<ul>" . $items->each("<li>{title}</li>") . "</ul>"; echo $pager->render($items); // render the pagination navigation This works perfectly for me - each page has 10 results and each page starts where the last one stopped. If that doesn't work, and you have pagination enabled for the template where you add this code, then I have no idea :)
-
Do you need to specify the start? As you can see here: https://processwire.com/api/ref/markup-pager-nav/ everything is automatically handled when you load MarkupPagerNav and use its render() method. No need to specify the start. Does that not work for you?
-
My apologies @fruid - I read this thread quickly and saw you comment about a custom paginated array and assumed that meant you were building up an array of pages rather than letting the pagination API handle querying the DB automatically. Sorry, I was in a rush and didn't fully grasp things. Good luck getting things sorted. I don't have time to dive deeper into this, but I guess I don't understand why you need to use the setStart() etc methods. I just build my selector and add a "limit=x" to it and that's it - everything else is automatic, but obviously I am not understanding your needs properly.
-
Have you read any of the linked posts from this thread:
-
Sorry, but I don't really think this is an accurate statement - I am running Tracy on many sites and it doesn't break pagination in Lister or in frontend templates on any of them. As discussed, I think there is something else going on with your setup and that JS error you are seeing that is contributing.
-
Interactions with Upgrades and Lister Pro breaks functionality
adrian replied to Kiwi Chris's topic in Tracy Debugger
There have been two changes to the Tracy Logs panel since 2019. This first one resulted in an "Uncaught SyntaxError: Unexpected end of input" error for Zeka, and the second one fixed that. I couldn't ever reproduce it though and don't really understand why he was seeing the error - my guess is maybe something to do with the way I am caching the results for the logs panel and maybe some DB encoding / escaping issues? https://github.com/adrianbj/TracyDebugger/commit/98fae74bcdb5e993d20f9fda37133c7979f39698#diff-6da6812cc20e34e30fb779775ef23d7cf2b15469ac373d4109480dd3c231c787 https://github.com/adrianbj/TracyDebugger/commit/81f3b427defabeb218b7a089432fe2e8c36be93c#diff-6da6812cc20e34e30fb779775ef23d7cf2b15469ac373d4109480dd3c231c787 -
Interactions with Upgrades and Lister Pro breaks functionality
adrian replied to Kiwi Chris's topic in Tracy Debugger
I still don't think it's an issue with Tracy, but rather because of the weird way the core Tracy files are loaded it's causing the error to have more impacts. I think if you solve the error, Tracy won't impact the Upgrades module or Lister pagination anymore.