-
Posts
2,007 -
Joined
-
Last visited
-
Days Won
21
Everything posted by dragan
-
Best way to handle saving an item as a favorite
dragan replied to ZionBludd's topic in Getting Started
I'm a bit confused. If only logged in users are able to save favorites, just create another textarea field in the user-tpl. Save items as JSON and use array_unique() to avoid duplicates. When outputting favs, just use json_decode(). And if persistence is necessary without having to log-in / register, just use cookies or local storage. If this list needs to be shareable, you'd need to think about a way to convert your array or JSON to a query-string - but that's easy.- 6 replies
-
- input
- user favorites
-
(and 1 more)
Tagged with:
-
This sounds strange. If you say "can choose one": Did you hack the table plugin so they have an actual dropdown-menu for table-classes? Or do you mean they can manually add one of your table CSS classes inside CKE? In an existing table, I can simply right-click anywhere in the table and choose "table properties" (Tabellen-Eigenschaften), and I see the same popup. This also works if I use frontend-editing. Provide some more details (browser, PW version etc.) please, then we can perhaps narrow down your specific problem.
-
Another question: Does it also create that "do you want to add it to your homescreen?" that was featured in the video?
-
What confuses me is: I get two folders in the ZIP: PWA, which contains generationInfo.json manifest.json Web-next-steps.md And a folder ServiceWorker3 with pwabuilder-sw.js pwabuilder-sw-register.js Do I have to put all these JS file into my site root? And do I have to keep them in these folders? The instructions on the generator site are a bit vague... Oh and... (maybe a stupid question, because you didn't mention it): Do I have to install this PW module as well?
-
Wonderful! I asked myself if I should tackle this when I wrote that thread, then forgot about it, and now this. I'll definitely test it out this week, because the current project (or rather, the client) uses so many PDFs, it drives me crazy.
-
@alxndre Thanks for the insights. So what you are saying is you still used PW, but the really large data-sets are in mySQL, and to gain query speed you used LessQL? Or did you even choose another DB-engine to optimize performance? Another question: Did you compare PW-queries vs. native mySQL queries? Or native mySQL queries vs. LessQL? "how big is big"? Care to give us an idea? 100'000+, millions? btw, there are similar discussions in the forums... @bernhard's CRM case study comes to mind, and a new module in the works.
-
yep. I'm not even sure what that code is: PHP, JS? Cron jobs won't do anything with JS+CSS... or HTML, for that matter.
-
@BitPoet re: DatetimeAdvanced module What exactly does it do? Is it some sort of datepicker input type that allows to select date-ranges? (which is not currently possible in core, afaik).
-
How did you set it up? Directly in .htaccess or with apeisa's module? This thread is quite old, but maybe you'll find some hints...
-
CKEditor: Restrict to a single input line/row
dragan replied to masslevel's topic in General Support
I would probably strip any extra p tags with a hook. It looks like all MathJax blocks create something like this: <p><span class="math-tex">...</span></p> It would be quite easy to just render the very first p tag which has the above span class .math-tex inside, and delete everything else. I'm sure as time goes by, authors won't even try to add more than one line anymore I also quickly tried some cheap CSS hacks, but they don't really work... e.g. restricting the RTE height: height: 62px; resize: none; overflow: hidden; -
Well, a little code would be useful. Is this in a regular frontend template, or inside your custom module? WIthout seeing some code, it's hard to say why you're not able to do a loop...
-
CKEditor: Restrict to a single input line/row
dragan replied to masslevel's topic in General Support
Try the MathJax CKEditor plugin https://sdk.ckeditor.com/samples/mathjax.html https://docs.ckeditor.com/ckeditor4/latest/guide/dev_mathjax.html it should even be available with AdminOnSteroids (a highly recommended plugin with tons of tools, extras, helpers, customization options etc.) -
Page Reference: Customer -> Location - Selection in template
dragan replied to zoeck's topic in General Support
I don't have a similar setup to quickly do tests myself, but... in your projects template, can't you try to use a page-reference field and use a custom/advanced selector for the allowed pages (using PHP code)? Another thing that might work: install the Connect Page Fields module https://modules.processwire.com/modules/connect-page-fields/ -
Thanks for sharing. I watched the entire video (no ads though... don't you use ad-blockers?). So... if you say that tool installs a couple of basic service workers. What exactly do they do? Enabling offline mode? Push notifications? "add to homescreen"?
-
Yeah, although I guess the main difference is that I have added other URLs to search too, like pw-recipes etc.
-
Did you try to merge your two custom modules into one? And also (since it seems to be a live site): can you go back to an old state (backup) where you are sure everything worked fine?
-
Post to database of another Processwire site
dragan replied to modifiedcontent's topic in General Support
Did you try out $config->sessionAllow from the last chapter here https://processwire.com/blog/posts/multi-instance-pw3/#more-session-control? Although... I'm not sure if this is related to the main subject of the blog post (multi-instance) or not... -
Both your custom modules use the same hook, and the same function-name createSubPagesForEdition(). I find that a bit strange, and potentially dangerous. Do you have control over which module is executed first? Also, the import/export function is labelled as "experimental" (don't know exactly why).
-
What exactly is this cron job doing?
-
Haven't used this module myself yet, but mpdf has a TOC function: https://mpdf.github.io/what-else-can-i-do/table-of-contents.html re: merge/prepend perhaps you can use this? https://mpdf.github.io/reference/mpdf-functions/importpage.html
-
There's no reason to feel sorry, we're a helpful bunch here On a sidenote: you can try the "PW custom Google search engine" I've configured some time ago: https://cse.google.com/cse/publicurl?cx=013706179141317928628:dendm4c3gpq I have used the title of this forum thread ("Restore trashed page from API") and the first result in this very thread here, and the second one is the API reference page for trash - at the bottom you'll see "related" API links, one of them being "restore". I have bookmarked this custom search so I can simply type "PW", hit enter, and search across a variety of PW-sites/resources. edit: kongondo was faster
-
Efficient development practices with ProcessWire
dragan replied to Vineet Sawant's topic in Getting Started
Yep - field/template overrides are great. re: working in a team I'm a big fan of JIRA (or similar tools). It's good practise to chunk your project into smaller tasks and sub-tasks. We even use it sometimes to estimate hours for quotes. If used right, everyone in the team sees who is working on what (swimlanes view). -
Is there a way to combine hooks to reduce the code
dragan replied to Juergen's topic in API & Templates
ahem... don't you want to use camelCase? preventDeletionLastEvent would be more readable than preventdeletionlastevent -> https://processwire.com/api/coding-style-guide/#4.6-methods