• Content count

  • Joined

  • Last visited

  • Days Won


dragan last won the day on June 11

dragan had the most liked content!

Community Reputation

784 Excellent

1 Follower

About dragan

  • Rank
    Hero Member
  • Birthday 10/18/1969

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location

Recent Profile Visitors

5,407 profile views
  1. @LMD Thanks for this post. I'll definitely keep this bookmarked.
  2. dragan

    oops, of course. Works like a charm now. . Thanks for the heads-up. Will keep it in mind.
  3. $this->addHookBefore('InputfieldTextarea::render', function($event) { $field = $event->object; if($field->name == 'body_offer') { $del = ''; foreach($this->wire->pages->get(11229)->textblocks as $item) { $field->entityEncodeText = false; $body = str_replace(PHP_EOL, '', $item->body); $body = addslashes($body); $title = $item->title; $field->description .= $del . "<a href=\"#\" class=\"ckesnippet\" data-snippet=\"$body\">$title</a>"; $del = ' | '; } } $js = wire('config')->urls->templates . 'scripts/ckesnippets.js'; $event->return = str_replace("</html>", "\n<script type='text/javascript' src='$js'></script>\n</html>", $event->return); }); I'm trying to add custom text-blocks from repeater fields into CKEditor. I've stolen the whole idea (and code) from @bernhard Problem is: The links are actually being rendered, but the Javascript is not loaded, i.e. the $event->return line doesn't seem to work. If I inspect the HTML, my additional script-tag is nowhere to be seen. I don't get any errors either. Running latest PW dev + PHP 7.1.19.
  4. dragan

    Does each company edit their products themselves? i.e. does each company have an admin-access? That would make the whole process / setup a bit more complicated. You would have to make sure that each company-admin only has the necessary rights to edit their own colours. It would all still be doable with PW - it would just need a bit more planning, and thinking ahead of the whole structure/architecture.
  5. dragan

    You also have to edit your site/config.php, mainly the database credentials and perhaps the allowed $config->httpHosts array. You can temporarily set $config->debug to true, to see error messages, should they occur.
  6. What's the reason for this strange sounding setup? So you want users to be able to create and edit pages, but not via the default template, and without the necessary rights? Why? Are you trying to create some sort of review workflow, i.e. the admin has to approve the classified first, and only he can then publish it? If that's the idea, you could simply work with page status: Only the admin can publish a new classified. (kinda like user-comments have to be reviewed and approved by someone, before it's published)
  7. dragan

    Why don't you use a pagefield? It's as simple as using $page->fieldname (inside the template). In _init.php, you would use $pages->get(123)->fieldname, where 123 is the id of the page your field lives in. If you have multiple instead of single values, you would have to loop through them, but that's easy as well.
  8. dragan

    OMG, not again... https://www.pilcro.com/blog/headless-cms By that definition, PW is most definitely a HCMS...
  9. dragan

    ?field=yourtab It's probably too late right now... approaching midnight here, but I am not sure where or how to use this. Do you have a simple example? You add that to your page-edit link as a param? If so, that's not an option, since I don't want to write a module, but still be in the "default" page-edit area. I don't want to mimick or refactor the whole page-editing somewhere else.
  10. dragan

    I know, but if you leave the admin, logout or go somewhere else, e.g. edit another page or whatever, you'll find that you get the 1st tab again. The general idea behind this question is: A relatively big page (lots of fields, lots of "show only if" conditions) should be split up into several "process steps" - hence the tabs approach. The user is supposed to be "guided" in the page-editing process that if he only has completed tab 1-3, the next time the page-edit screen is opened, tab 4 is shown. Think of multi-step forms, a shop checkout process or similar.
  11. Is it possible to open a specific tab, when in page-edit mode? Let's say I have 5 tabs (more than just the default "content" tab - 4 more created with field-groups), and the user is in tab 3. How can I possibly manage to set tab 3 again to active/selected when the same user wants to edit the same page after x days? Are there any in-built methods I could use? And which hook(s) would be necessary?
  12. dragan

    https://processwire.com/api/ref/wire-mail/ Use $m->bodyHTML('<html><body><h1>Message Body</h1></body></html>'); in addition to $m->body();
  13. dragan

    If you reduce the image max-width (or the div above with no class) to approx. 66%, it looks OK. But ONLY in IE Maybe use MS vendor prefixes for IE, or the old if-IE conditional tags
  14. Awesome. I also like @theo's "preview / page-grid" module a lot. I realize they don't do the same stuff, but just imagine if you had both functionalities available!
  15. What error exactly? You should post the error message here as well.