Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/30/2017 in all areas

  1. @Robin S - sure, here is some info on how i use page flags (sorry if this is off-topic and/or verbose!) 1) i setup a (page reference) field to hold flags for any page (usually I use chosen select, but ASM select is also good for this); Users have to be able to add flags. 2) I start traversing through a type of content, (in this case the musical works of a pretty famous composer), and find problems; for this project the works were imported from another system, and now need to be cleaned up; the flags helps us to track, group, filter the works that have certain issues, or maybe need attention from some specialized member of the team; I have also setup a certain amount of auto-flagging, just by checking the fields on save and adding the flag if problems are found – for example (on a different site) the admins want to add a subscription form strategically inside the body content of their blog posts; there was no easy way to do that except by manually adding the hanna code to the body copy where they want it; But they have several hundred blog posts and don't know which ones they missed; so i have the system scan the body field for the hanna code and if not there, add the 'missing subscribe form' flag to those posts.
    5 points
  2. I've used https://themeforest.net/item/canvas-the-multipurpose-html5-template/9228123?s_rank=1 for a number of sites and found it covers most of my front end requirements. It has a heap of page templates that are easy to convert to PW templates and individualise for client site looks.
    3 points
  3. For our final dev branch version of 2017, we've added a couple new features that I think you'll find useful. For starters, we've added drag-and-drop (and paste) image upload support to our richtext editor (CKEditor), which is really handy. We've got all the details and a short screencast here as well. https://processwire.com/blog/posts/pw-3.0.87/
    2 points
  4. hm... @dragan i guess the runtimemarkup field only has to return the "<button>" element (without the <li>, <div.InputfieldContent> and so on... you are right see this post for example (and the following): and also this: https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/#using-internal-components-modules (scroll down to the buttons section)
    2 points
  5. @psy although I don't have a need to look out for a theme for a client project, I decided to buy the Canvas theme anyhow. Right now there's a sale going on, so it's only $10 Gonna use it to quickly build prototypes and whatnot... It will surely look better than "naked" Bootstrap/Foundation setups....
    2 points
  6. Can't believe I discovered this awesome module only recently... I mean, it's over 2 years old now already Here's another use-case:
    2 points
  7. Another nice one: http://input.fontbureau.com/
    2 points
  8. @nickngqs, a few more options for executing API code: Tracy Debugger's Console panel Tracy Debugger's Snippet Runner panel Admin Actions module
    2 points
  9. FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/ GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin). The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen. The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages. The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan! Warning/Consideration Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API Backend Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer. FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. A very simple example. return 'Hello'; Simple example. return $page->title; Simple example with markup. return '<h2>' . $page->title . '</h2>'; Another simple example with markup. $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example. $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example. $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do: return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows: return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup') Access the field on the current page (just like any other field) echo $page->runtime_markup; Access the field on another page echo $pages->get('/about-us/')->runtime_markup; Screenshots Backend Frontend
    1 point
  10. Hi all. For a while now been wondering how many would be interested in a backend and frontend shop catalogue built on top of PadLoper? I've previously spoken to @apeisa about this and his take is that there are no plans to develop PadLoper in this direction but he's happy to support such efforts. The gist of the backend shop catalogue is to provide one place (think ProcessModule) where you can manage your PadLoper products - add, edit, delete, track sales, etc without having to set up the underlying structure yourself. The frontend would be like a shop/webstore profile, a frontend cart basically, that's customisable. The shop would be 100% powered by PadLoper. This means that to use the 'shop catalogue' would require that PadLoper is installed. These are just loose ideas at the moment for a pro module. This might or might not see the light of day depending on feedback. Anyway, would love to hear thoughts, thanks.
    1 point
  11. Just tried it: it works Just follow the RuntimeMarkup instructions, and make sure you choose the wireRenderFile method. Add your new RM field to your repeater, and include something like <li class="Inputfield InputfieldSubmit Inputfield_submitSelection uk-width-auto uk-margin-top uk-grid-margin uk-first-column reloaded InputfieldRowLast" id="make-this-id-unique"> <div class="InputfieldContent uk-form-controls"> <button id="make-this-unique-too" class="ui-button ui-widget ui-corner-all ui-state-default" name="ditto" value="Submit / Send x" type="submit"> <span class="ui-button-text">Submit / Send x</span> </button> </div> </li> I guess you'll want to edit the IDs, and add data-attributes or hidden fields to do whatever you've got to do
    1 point
  12. Well, each item inside a repeater is a field. Since there are no button input fields you could choose from, you could try building something with FieldtypeRuntimeMarkup? https://modules.processwire.com/modules/fieldtype-runtime-markup/
    1 point
  13. Also, there is a nice monospace font with ligatures support you can use, its supported in atom, vscode, brackets etc. You guys might like it: https://github.com/tonsky/FiraCode
    1 point
  14. Hi @dragan First of all thank you for your help @adrian @dragan I was wrong about localPath and localName. They are hookable. The problem was that I never called them in my templates, so didn't get any changes. $pages->addHookAfter("Page(template=projects-category|project)::localUrl", function (HookEvent $e) {; $page = $e->object; $pages = wire('pages'); $user = wire('user'); $language = $user->language; $langSegment = $pages->get("/")->localPath($language); $pageName = $page->localName($language); if ($page->matches("has_parent=projects")) { $e->return = $langSegment . "projects/$pageName/"; } elseif ($page->matches("has_parent=products")) { $e->return = $langSegment . "products/$pageName/"; } }); Hook to Page::path also works. The issue was in my "matches" selector ))))) $pages->addHookAfter("Page(template=projects-category|project)::path", function (HookEvent $e) { $page = $e->object; $pages = wire('pages'); $user = wire('user'); $language = $user->language; $langSegment = $pages->get("/")->localPath($language); $pageName = $page->localName($language); if ($page->matches("has_parent=projects")) { $e->return = $langSegment . "projects/$pageName/"; } elseif ($page->matches("has_parent=products")) { $e->return = $langSegment . "products/$pageName/"; }; }, array('priority'=>101));
    1 point
  15. I get a fatal error, when I want to edit a page that has no image field. Well, actually there are image fields, but they are part of repeaters or matrix-repeaters, or some other fields. btw: this refers to the wire module file, not site The template of this page has the following fields/field-types: I feel kinda bad for posting all these issues... I'm sure the community can wait till 2018 until these things are ironed out. Enjoy your well-deserved holidays!
    1 point
  16. I use atom https://atom.io/ and some packages like: https://atom.io/packages/jQuery https://atom.io/packages/jquery-snippets
    1 point
  17. @nickngqs most of what's described on this thread you can also achieve by using my Dynamic Page Fields module It's still experimental, and I didn't have much time to continue working on it, but it worked pretty well on my tests
    1 point
  18. Yeah, I think this belongs in @pwuser1's other thread about IDE autocompleting in general. While you might find one editor better for jquery code completion and a different one that's better for php code completion, are you really going to switch editors depending on what you are working on? Just find a good editor and download a plugin for jquery code completion - all the big ones will have one.
    1 point
  19. You have three possibilities. The first one, you can write the code in a template file inside your site/template folder, the second you can write the code in a bootstrapped script in the root directory (or where you want, you just have to adjust the path of the index.php). The thrid, inside a module. Read the whole thread, you should find what you need. What are you trying to achieve ?
    1 point
  20. here is a screenshot of a dashboard, i'm using a simple grid framework + a free admin theme (AdminLTE 2) + masonry for the 'widgets'; i use 3-4 types of widgets, one is a set of shortcuts which is configurable to show on different users, or access levels; this allows individual users to have their own custom set of shortcuts if needed. The other types of widgets are a mini lister, and a formbuilder list; The formbuilder list can display recent submissions to various forms, and is helpful for admins who want to see a quick overview of recent submissions.
    1 point
  21. @Federico I did a little exercise myself after your last forum thread (without using @kongondo's VS though)
    1 point
  22. @tpr, I've been having a look at getting the field edit links working inside repeaters. The solution is pretty simple. At line 2342... if ($field = $inputfield->hasField) { //... And because of the suffix added to the name of inputfields inside a repeater I think it would be good to make this change at line 2354... $editFieldTooltip = '<em class="aos_EditField">' . $field->name . '<i class="fa fa-pencil"></i></em>'; ...to use $field->name instead of $inputfield->name.
    1 point
  23. Woah! Put down your counter arguments. Now I've got your attention, hope you all have a great Christmas
    1 point
  24. I agree with @horst about creating a new homepage - I don't think it will be possible and certainly confusing if it was. For testing code, I am going to shamelessly promote TracyDebugger. You can use the Console panel to run any code, or if you want to test changes to the code of a particular template, use the Template editor panel which lets you "Test" the changes without actually affecting the code that is being served up to all other visitors. As for the Pages > Add New and only seeing bookmarks, that is due to your template setup - you need to read up on how to get that add new option working. The main/default way to add a new page is from the "New" action button when you mouseover the parent page in the page tree.
    1 point
  25. I'm not 100% sure if I really get what you are asking for. (?) I think it isn't possible to create another "homepage" besides the one existing, because it is a unique and single page. It is the root page and cannot have any siblings by design. It is the (root) parent of all other pages. But when I want to try out new codes in a homepage of a running site, I go into the template file of the homepage and put in a conditional like this: // on top of the homepage template file $testingOnTheOpenedHeart = true; // :) if('horst' == $user->name && $testingOnTheOpenedHeart) { // when I'm loggedIn and have set the conditional to test out something new, ... include(__DIR__ . '/_myHomeTemplate4TestingPurposes.php'); // ... include alternative file with my test code ... return; // ... and skip the following code from the original template file! } // following code // ...
    1 point
  26. https://themeforest.net/ https://templated.co/ https://html5up.net/
    1 point
  27. I found a bug: if(!$ptf->has($child->id)) { $pp->{$ptf->name}->add($child); $pp->of(false); $pp->save($ptf->name); } Should be: if(!$pp->{$ptf->name}->has($child)) { $pp->{$ptf->name}->add($child); $pp->of(false); $pp->save($ptf->name); } It was re-writing the PageTable items every time, which made it impossible to reorder items.
    1 point
  28. Sure it’s possible. I’d love to see a more page-field-like PageTable, actually. Here is a (really, seriously) half-assed module that lets you add a page to a PageTable field. Be aware, when you remove your page from the field, it will trash the entire page just like the standard PageTable does. Do NOT use this anywhere but in a testing environment. It also has a hard coded template that you shoult probably change to whatever your PageTable accepts. $this->addHookAfter('InputfieldPageTable::render', $this, 'PageTableRender'); public function PageTableRender($event) { $pageTable = $event->object; $out = "<select name='{$pageTable->name}_addcustom'>"; $pages = $this->pages->find('template=PAGETABLETEMPLATE'); //change this foreach ($pages as $p) { $out .= "<option value='{$p->id}'>{$p->title}</option>"; } $out .= '</select>'; $out .= "<script> $(document).ready(function(){ $('select[name=\"{$pageTable->name}_addcustom\"]').change(addPage); function addPage() { var input = $('input[name=\"{$pageTable->name}\"]'); var container = input.siblings('.InputfieldPageTableContainer'); var dataurl = container.attr('data-url'); var pageid = $('select[name=\"{$pageTable->name}_addcustom\"]').val(); var ajaxURL = dataurl + '&InputfieldPageTableAdd=' + pageid; $.get(ajaxURL, function(data){ container.html(data); container.effect('highlight', 1000); }); alert('wtf did you do'); } }); </script>"; $event->return .= $out; } As you can see, the heavy lifting in the PageTable field is done via Ajax. Maybe it’s a starting point. I really need to go to bed
    1 point
  29. yeah but a little api magic can cure that.. open up your tools or api playground and: $pp = $pages->get(1234); // page you're adding the children to the page table foreach($pp->children as $child) { $pp->page_table_field->add($child); }
    1 point
×
×
  • Create New...