Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/26/2019 in all areas

  1. Hello @SeriousUser depending on the website needs, it seems like a reasonable structure. Having said that I would allow myself to suggest those HTML containing fields to be replaced with one/a combination of other fields which would give you more flexibility during a theme building and most important - eliminates issues with the markup. To my experience, the markup is always better to be added to the templates which would then call for the field content. BTW, I like the diagram visualization. What have you used to construct it?
    2 points
  2. I'm just wonderin because of last point from READE.me say: So I'thought this is already implemented. I know, just wanted to save some time ? I think it would be great to be relative flexible. Perhaps we may have a field (maybe a repeater could do) where you specify what kind of cookies your website serves. On each repeater there should be in my eyes some possibility to explain what the cookie does and why it is used. I also like the "Necessary" checkbox which can't be disabled. BTW: Great module, thanks for @adrian creating and @wbmnfktr for maintaining it!
    2 points
  3. I could add a second option to that dropdown. Something like CustomCSS, add a specific class to the HTML and you can add your very own CSS and style it however you like it. Another way would be disabling the auto-load assets option in the settings and add custom CSS right away. I thought about something like that but I'm not sure which way to go here - for now. The solution used by Deezer is provided by CookieBot and is quite powerful. Yet a bit too much for most I guess. What/which options do you need in most of your projects? I'm happy to hear more opinions, suggestions and ideas.
    2 points
  4. Solved! Thanks @Zeka Solution: <?php // in my auto-loaded custom module public function init() { $this->addHookAfter('ProcessPageView::pageNotFound', $this, "unpublishedProfile"); } public function unpublishedProfile (HookEvent $event) { $page = $event->arguments(0); if ($page->isUnpublished() && $page->template == 'profile') $this->wire('session')->redirect($this->wire('pages')->get(1312)->url); }
    2 points
  5. Hello all. I am studying this CMS and I would like to ask you a question. Is this setup good? - Blue pages are pages that have a template associated with them. - Orange page is a hidden page where i store generic website data usefull for header and footer area. Is this correct? question 2: if you want to create a rich content like WP-visual composer or like Wp-gutenberg how can I do? Danke!
    1 point
  6. Try: https://processwire.com/api/ref/page/get-field/ $page->getField('Formattext01')->id
    1 point
  7. This was fixed in 3.0.144: https://github.com/processwire/processwire-issues/issues/1027
    1 point
  8. New Version 1.0.4 - Fixes empty value bug for FieldtypeInteger. @dragan I was able to reproduce error for FieldtypeInteger. Turns out ProcessWire returns an empty string instead of null when FieldtypeInteger is empty. That's why GraphQL schema was complaining about getting empty string instead of Int. Let me know if the latest patch works for you.
    1 point
  9. @elabx was right :-) Here't two ways in addition to @dragan's above: Method 1: Call Hanna inside your function function SomeFunction(){ $out ="<div>"; // hanna in here $hanna = wire('modules')->get('TextformatterHannaCode');// @note: wire! $out .= $hanna->render("[[hello]]"); $out .="</div>"; return $out; } $out = SomeFunction(); echo $out; Method 2: Pass your function an argument/parameter with Hanna rendered output $hanna = $modules->get('TextformatterHannaCode'); $hannaString = $hanna->render("[[hello]]"); function SomeFunction2($string){ $out ="<div>"; // hanna in here $out .= $string; $out .="</div>"; return $out; } $out = SomeFunction2($hannaString); echo $out;
    1 point
  10. This looks like a reasonable approach! There is currently nothing like those tools you mention. What I've seen works for a lot of ProcessWire developers is to use the Repeater Matrix module to create content. Take a look here: https://processwire.com/store/pro-fields/repeater-matrix/
    1 point
  11. Design: polimorf.de Development: muskaat.de They team up for tasks like that and I'm also part of Muskaat. ? So feel free to take a look at the references there. Located in Neumünster - close enough to Hamburg for meetings.
    1 point
  12. @valan You need to include both the autoloader from Composer and the ProcessWire bootstrap file, see Bootstrapping ProcessWire CMS. Assuming your autoloader lives under prj/vendor/autoload.php and the webroot with the ProcessWire installation under prj/web/, you can use the following at the top of your script: # prj/console/myscript.php <?php namespace ProcessWire; # include composer autoloader require __DIR__ . '/../vendor/autoload.php'; # bootstrap processwire require __DIR__ . '/../web/index.php'; ProcessWire will detect that it is being included in this way and automatically load all the API variables (and the functions API, if you are using that). Keep in mind that there will be no $page variable, as there is no HTTP request, so there is no current page.
    1 point
  13. This is the way to create template and fields with API: // new fieldgroup $fg = new Fieldgroup(); $fg->name = 'new-template'; $fg->add($this->fields->get('title')); // needed title field $fg->save(); // new template using the fieldgroup $t = new Template(); $t->name = 'new-template'; $t->fieldgroup = $fg; // add the fieldgroup $t->noChildren = 1; $t->save(); // add one more field, attributes depending on fieldtype $f = new Field(); // create new field object $f->type = $this->modules->get("FieldtypeFloat"); // get a field type $f->name = 'price'; $f->precision = 2; $f->label = 'Price of the product'; $f->save(); // save the field $fg->add($f); // add field to fieldgroup $fg->save(); // save fieldgroup All pretty much standard OO one can figure out looking at core and PW modules. But not someone unexperienced would figure out by themself. I think at some point we need to cover these in a documentation.
    1 point
×
×
  • Create New...