Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/11/2016 in all areas

  1. Well that took me a lot less time to implement than it did to add the content I needed for testing it out. Worked like a charm, didn't need any tweaking at all. The only thing I noticed missing was the keyboard fine-tuning. But that would conflict with Reno theme's expanding / collapsing of the left column, so best leave it as it is. In this case, on the frontend I have a rollover behavior that pops up an info box on each spot. The box pops to the right, so I'd have a problem with the ones closer to the right edge. But since the module returns % based positions, I can easily add a CSS class whenever the dot is over 50% horizontal, to make the popup appear to the left instead. The filtering options for the page selector also worked great. Limited that to a specific template and voilá. On the image below you'll see I have white and red dots on the frontend. Those are according to the parent of each dot. Easy as pie. Great work @kongondo. Here's a side by side of the field, and the end result:
    4 points
  2. This week is all about repeaters, something that we didn't cover on the roadmap last week–we always like to save a few surprises to keep things interesting. We've also got a preview of the new Repeater Matrix field coming soon to the ProFields package… Read the post here: https://processwire.com/blog/posts/processwire-3.0.4-repeaters-revisited-preview-of-profields-matrix/
    2 points
  3. Update: Version 3 Unified markers working fine (thanks @heldercervantes) Fixed position differences between the 3 marker styles; (thanks @heldercervantes) Unified look, so that all marker styles feature the same kind of border and colors; (thanks @heldercervantes) Improved the way markers are highlighted; (thanks @heldercervantes) Added a higher z-index to the highlighted marker, bringing it on top of the others; (thanks @heldercervantes) Tweaked draggable event to remove the snapping that happened when user started dragging the marker. (thanks @heldercervantes) Callout markers display referenced page title instead of marker number Confirmed testing OK with Reno Theme Ready to grab from Github Pending: ReadMe/Docs...+ long coordinates table..
    2 points
  4. That's probably a include path or permission issue within your operating system rather than an issue of wireshell. Composer does use a specific folder to install global packages and this does need to be included in your users path variable and you need to have permission to execute files in that folder.
    2 points
  5. @kongondo, just made a little tune-up on your code: Affected files: InputfieldImageMarker.css InputfieldImageMarker.js Changes: Fixed position differences between the 3 marker styles; Unified look, so that all marker styles feature the same kind of border and colors; Improved the way markers are highlighted; Added a higher z-index to the highlighted marker, bringing it on top of the others; Tweaked draggable event to remove the snapping that happened when user started dragging the marker. Suggestion: Callout and teardrop styles seem redundant. I suggest that on callout style, instead of the number, we show the page name. CSS is ready for this change, just output the name in the span and it expands from the center. You can find the update here: heldercervantes.com/experiments/ifim/FieldtypeImageMarker_2.zip I'm starting to implement this on a website right now. It will be a good testing ground. First impressions are good, second impressions coming soon.
    2 points
  6. This module lets you restrict users to a certain branch of the page tree - it can limit editing permissions, as well as the page list view to this branch. http://modules.processwire.com/modules/admin-restrict-branch/ https://github.com/adrianbj/AdminRestrictBranch Restricted View Non-restricted View Note that this module does not add permissions (unlike how PageEditPerUser and PageEditPerRole work), so the user must have template level permissions to edit the pages in the restricted branch. What this does allow though is giving all users/roles editing access for the home template and allowing that to inherit all the way through the page tree and let this module restrict to specific branches. As you can see from the screenshots you can specify how to determine the branch to restrict the user to - either via a matched role name, or via a dedicated page select field on the user's profile. The match role name works like this - if you have a series of branches called: Branch One, Branch Two, etc, users with a role named: branch-one will only have access to Branch One. You can also decide whether to restrict page tree viewing as well and editing privileges (default) or just editing privileges. The Branch Exclusions option is important for things like external PageTable parent branches etc. Main module config settings User specific branch setting on user profile page This module came out of my personal needs as well as this discussion: https://processwire.com/talk/topic/11428-project-design-main-shop-hundreds-of-affiliates/ As always, feedback is very welcome.
    1 point
  7. Fieldtype and Inputfield ImageMarker As of 02 January 2018 ProcessWire versions earlier than 3.x are not supported Version: Stable Project Page: Github Modules Directory: http://mods.pw/Bk OR http://modules.processwire.com/modules/fieldtype-image-marker/ Requires: ProcessWire 2.4 or greater ######################## About This module allows you to easily 'place markers' on an image. Each placed marker's position/coordinates (x and y) are saved in the field as well as the ID of the ProcessWire page the marker refers to. In the backend markers are placed on a specified base image. In the frontend, using each saved page ID you can then retrieve any information you want about the pages being referenced and display that on your website over the same base image you used in the backend. The module is useful for a diverse number of uses including: Product demonstration: place markers on various parts of your product to showcase its features. Using a bit of CSS and/or JavaScript you can create pop-up boxes displaying more information about that feature of the product. The information (in this case, feature), would be information you've stored in some field (e.g. a text field) in the page marker (i.e. the page being referenced by the coordinates). Office locations: place markers on a map showing global offices of a multinational company Points-of-Interest: place markers showing points of interest on a map or location or anything. The coordinates are saved as percentages. This means they will scale well with the image being marked. This module came about as a result of this request. @credits Ryan Cramer: This code borrows from his FieldtypeEvents. @credits Helder Cervantes: Module concept, HTML, CSS, JavaScript. @credits Roland Toth: CSS, Inspiration. API In the frontend, the field returns an array of ImageMarker objects. Each of these has the following properties info (integer): The page ID of the marker (i.e. the page being referenced by the marker. Using this, you can get the referenced page and have access to all its data. infoLabel (String): The title of the page (above) referenced by the marker (runtime only). x (Integer): The x-coordinate of the marker (%). y (Integer): The y-coordinate of the marker (%). You grab the properties as in any other PW field, e.g. $out = '<img src="'. $page->base_image->url . '" alt="">';// image to place markers on 'base_image' is the name of the file field foreach ($page->marker as $m) { // do something with the following properties $m->id;// e.g. $pages->get((int) $m->id); $m->x; $m->y; $m->infoLabel; } // the CSS and HTML are up to you but see InputfieldImageMarker.module for examples Frontend implementation is left to you the developer/designer
    1 point
  8. This is updated/version of the AdminDocsTab module as was posted here: https://processwire.com/talk/topic/11803-admindocstab/ (that one is now obsolete) https://github.com/outflux3/AdminHelp AdminHelp module for ProcessWire Processwire helper modules for managing site documentation. Currently alpha state - please use with caution and report all errors. Instructions There are 3 modules included with this: the master module holds the settings for the other 2. This is a helper module which expects you to have already setup a hidden part of your page tree* to establish your help documentation, using any template (e.g. 'help-doc') and a body field (ckeditor) (*or you can run the setup and it will create these items). The help-doc template does not need to have an output template, as the module will only echo the body field inside the admin. In addition this 'help-doc' template requires "template select" field (separate module) which should be named template_select. (if you run setup it will create this). To have a global help page, which renders all of the help docs in an accordion view, you can install the ProcessAdminHelp module, which will setup a page to view the help docs, under setup. Help Setup Module (AdminHelp) This is how the setup module looks before setup is completed: If you use the automated setup, it will create the field, templates and pages, and will auto-set the module configuration: Example Help Tab (when using AdminHelpTab) Admin Help page (ProcessAdminHelp) This shows all help docs in accordion. (it is capable of displaying child pages also but this is not currently implemented in the module due to the family settings of the default templates). Accordion opened: Features Summary: Manages settings for the help templates (help-index, and help-doc), which enabled users to add new help docs where applicable; these can already exist and be named whatever, you just specify them in the setting. Getting the help/docs tab to show up in the right place (based on user preference template selected on the help doc). Has it's own scoped CSS styling that makes the documentation readable and engaging; has some @import fonts, and also rules to make text layout look correct in PW admin (paragraphs, lists, headings, blockquotes etc.) Makes it easy for site editors to add their notes, mods/edits/enhancements to the docs (edit button - currently only enabled for Superadmin - this can be made a setting based on user feedback). Using the secondary process module will create a 'Help Docs' page under Setup where you can view all of the docs in 1 place as an accordion. (could be moved somewhere else) There is also an automated setup that can run, where it will create the field, templates, and pages for you to get started. This module is probably optimized to handle no more than 10-15 or so help pages; if you needed more than that, the Process module may need to be changed to work differently. Most sites I do need around 4-5 help pages. *If you don't want to load those extra google fonts in your admin you can modify the CSS to your needs, e.g. remove the @import and then change the few lines of css that reference those; Once there have been a few testers, I can see about adding this to the modules directory in a week or so.
    1 point
  9. Template Cache and $page->render($options) If you ever use the $page->render() to render out partials (of another page using its template file) and use template cache for the pages you're going to render and the page where you render it, it will create a cachefile. So if you go to that previously rendered and cached page, it will render that partial. If the page is accessed before a cache is created, it will cache this one and render that in as the partial, so kinda turned around. Funny effect. And many mmms and oaaahhhs To get a better understanding what's happening read on. Simple example code from a list page to render partials of articles (likely) // from the list pages template $markup = ''; foreach($products as $key => $child) { $markup .= "<dl>"; $markup .= $child->render(array('isOverview' => true, 'class' => $class)); $markup .= "</dl>"; } echo $markup; And in the template of the article // in article template file if(isset($options['isOverview']) && $options['isOverview'] == true) { // render small partial $class = $options['class']; $markup = "<dd class='$class'> <h4>$page->title</h4> <p>$page->summary</p> <a href='$page->url'>details</a> </dd>"; } else { // render complete article $markup = "<div class='product-details'> <h1>$page->title</h1> $page->body </div>"; } // output echo $markup; So now the render call $markup .= $child->render( array('isOverview' => true, 'class' => $class) ); in the list template will cache the page it renders (the small view of it). Thus if you access the page directly it will serve the cached small view of it. Ups. Solutions This is without specifying a different template file in the first argument in the render(). The effect doesn't happen when you, let's say create a new template file (ie article-small.php) and use that to render the page. Since this new template file is not connected to the template in PW it also has no cache for that render. To show what I mean is the following with the first argument the file you want the view to render. $markup .= $child->render("product-small.php", array("isOverview" => true, "class" => $class)); Still following me? Ok there's also another method to not allow a cache file to be created. There's a default options set in the render() in PW. Bingo! allowCache is what we can also use. $markup .= $child->render("product-small.php", array( "allowCache" => false, "isOverview" => true, "class" => $class )); And everything's back to normal. Just wanted to write down a little thing, as I stumbled over this recently, to scatter some keywords about this here . I think this isn't really documented somewhere but I thought it was maybe mentioned by Ryan in a thread about when he added this feature: http://processwire.com/talk/topic/3145-multiple-views-for-templates/page-2?hl=%2Brender+%2Bcaller#entry32876. Edit: Zaaakkkk and it's in Google 9 minutes !
    1 point
  10. -------------------------------------------------------------------------------------------------------------------------------- for PW 3.0+ please follow this link! -------------------------------------------------------------------------------------------------------------------------------- Croppable Image Module for PW >= 2.5.11 and PW <= 2.7.3 Version 0.8.3 alpha Hey, today I can announce an early (alpha) release of CroppableImage, what was forked from Anttis Thumbnails module. Until now there was a lot of work done by owzim, Martijn Geerts and me. We have solved the issues regarding the list from here: The modules are bundled together so that you only can and have to use FieldtypeCroppableImage for install, uninstall & configure. It uses new naming scheme that was introduced with PW 2.5.0 that supports suffixes. The complete image rendering is delegated to the core ImageSizer, or to any optional hooked in rendering engine. Template-settings are now fully supported, including removing variations when settings have changed. It fully respects settings for upscaling. If upscaling is set to false, you cannot select rectangles smaller than the crop setting. We implemented these enhancements: The GridView now is very nice and compact, and also benefits from the lately introduced setting for $config->adminThumbOptions. Permanent storage of the crop coordinates, quality and sharpening settings are now implemented native. No need to use PiM for this anymore. The usage/display of the Quality and Sharpening DropDown-Selects can be globally disabled/allowed in the modules Configpage. (additionally to that a setting on a 'per field base' is planned.) And the most wanted feature by the community: It gives back a pageimage and not the URL-string. This way you can use it like this: // get the first image instance of crop setting 'portrait' $image = $page->images->first()->getCrop('portrait'); You can further use every pageimage property like 'url', 'description', 'width' & 'height' with it: // get the first image instance of crop setting 'portrait' $image = $page->images->first()->getCrop('portrait'); echo "<img src='{$image->url}' alt='{$image->description}' />"; And you can proceed further image rendering with it: // get the first image instance of crop setting 'portrait' and proceed a resize with imagesizer $image = $page->images->first()->getCrop('portrait'); $thumb = $image->width(200); // or like this: $thumb = $page->images->first()->getCrop('portrait')->width(200); // and if you have installed Pia, you can use it here too: $thumb = $page->images->first()->getCrop('portrait')->crop("square=120"); The only downside with this is that when you (as the site developer) have enabled the usage of DropDown-Selects in the images editor, you do not know the values the editors have chosen for the images. As a workaround for this you can use the getCrop() method with a second param. This is a PW selector string. It can contain as many of the known pageimage options like 'quality', 'sharpening', 'cropping', etc, as you need, but none of them is required. But required is at least one setting for 'width' or 'height': $image = $page->images->first()->getCrop('portrait', "width=200"); $image = $page->images->first()->getCrop('portrait', "width=200, height=200, quality=80"); $image = $page->images->first()->getCrop('portrait', "height=400, sharpening=medium, quality=75"); . . You can get the module from GitHub: https://github.com/horst-n/CroppableImage (Better Docs are coming soon) Screenshots Related Infos A good setting in site/config.php for the AdminThumbs are: (height=>200 and scale=>0.5 !) $config->adminThumbOptions = array( 'width' => 0, 'height' => 200, 'scale' => 0.5, 'imageSizer' => array( 'upscaling' => false, 'cropping' => true, 'autoRotation' => true, 'sharpening' => 'soft', 'quality' => 90, 'suffix' => array(), ) );
    1 point
  11. i really liked the "save + new" and "save + close" button back in my joomla days here is the first version of a module to bring this functionality to processwire. i know there's the save actions module, but that's not exactly what i wanted... module is alpha state https://github.com/BernhardBaumrock/SaveButtonEnhanced i have one problem where i need your help: i want to submit the #ProcessPageEdit form via a jquery click() event: https://github.com/BernhardBaumrock/SaveButtonEnhanced/blob/master/SaveButtonEnhanced.module#L126 but unfortunately that does not submit the form reliably. sometimes it works, sometimes it doesn't. most of the time i need a second click. also i was not able to trigger the click like this: $('body').on('click', '.sbe_action', function() { console.log('clicked a sbe item'); }); it just did nothing does anyone know what is the problem here? would really appreciate it.
    1 point
  12. Thanks elabx. I finally got it working.
    1 point
  13. Done, works fine! Tested with Reno Theme as well (see screens). Thanks. Updating repo now... Reno Theme view
    1 point
  14. Ok, maxwidth was playing pranks. Just add these couple of lines: max-width: none; white-space: nowrap; in the "div.callout span {" statement on line 142, and names should show up nice on the callouts.
    1 point
  15. OK, found it elsewhere on this forum: https://processwire.com/talk/topic/7525-module-processwire-core-upgrade/page-4 After manual upgrade of ProcesswireUpgrade module all was fine again!
    1 point
  16. Check this out. It tells you exactly what you need to do and shows you what your page will look like on facebook.
    1 point
  17. I think one enhancement that would really help pageTable stand out in certain use cases would be if it had the ability to search for and add existing pages that matched the templates assigned to it from anywhere in the system (or a limited set). Basically, a PageTable/Page Field crossover.
    1 point
  18. The new repeater is awesome in design and function! I use PageTableExtended for a similar feature like repeater matrix but with prerendered output like a contentblock builder on every page where you can put in text, text with image, galleries, maps and so on - for such complex things rendering the single templates is much more easier to maintain but more complex to setup. Also PTE works like a preview of the builded contentblocks and on other things you could create a own view for backend and frontend... I'm very exited about the new features, but Pagetable would take his place i think.
    1 point
  19. ? $page->parent; http://cheatsheet.processwire.com/?filter=parent See also: $page->parentID; $p = $page->parent;// here, $page->parent will give you the parent page object of the current page or nullpage if it does not have one echo $p->title; if($p->id == $someOtherID)// do whatever....
    1 point
  20. Thanks, I've taken that advice and everything works great. Sanitizing to an image object means I avoid having to check for object vs. string in the sleepValue method. For novice developers like myself I think it's a bit hard to grasp the sanitizeValue method because it's not obvious where the method is called. With some debugging it looks to me like sanitizeValue is called twice, with the flow being: inputfield > sanitizeValue > sleepValue > database and database > wakeupValue > sanitizeValue > page Is that correct? It's the first call that puzzles me a bit because the comment in Fieldtype.php for sanitizeValue says: And I can't see where the "Page instance" comes into inputfield > sanitizeValue > sleepValue > database @kixe Thanks for directing me to your module - I haven't tried it before and it looks like it's very flexible. It's not quite suitable for my purposes for a few reasons: I want my select dropdown to include the images from all the image fields assigned to the template. Because each image field is a separate table in the database I don't think Fieldtype Select External Option will allow this. I want to customise the select inputfield so it shows a thumbnail of the selected image (so it's easier for the user to select the image they want). I'm doing this by setting a thumbnail data attribute for each option in the options array. So my module needs to be something specific to images rather than Fieldtype Select External Option which has a broader application. When used for image fields, it seems that the value saved by Fieldtype Select External Option is quite fragile. Because the option value has to be an integer you have to use the Sort column for the value. This means that if the images are reordered in the image field the image referenced by Fieldtype Select External Option is changed. For an image reference you really want the image name to be the value that is stored. Also, I got some errors when attempting to install Fieldtype Select External Option. They are caused by the strings that are marked as translatable. I think lines like... $f->label = _('Usage'); ...need to be... $f->label = $this->_('Usage');
    1 point
  21. You second jquery file overwrites the first instance to which fancy box did bind itself. The overwritten jquery does not know anything about the previously bound fancybox.
    1 point
  22. PageTable is particularly handy if you need control over where the data is stored. Repeaters handle this part automatically behind the scenes, but with PageTable you have more options, such as making stored items children of current page, etc. In some cases the UI of PageTable is also preferable. Of course there's also the free vs. commercial point of view: with PageTable you get the multiple templates feature right out of the box, but with Repeaters you'll have to get the (commercial) Matrix version in order to pull that off.
    1 point
  23. Who would forget this ?? v0.2.1 - Regardless whether a mail has been sent or not, if saveMessages is enabled, the data will be stored. Besides a corresponding log entry will be saved.
    1 point
  24. You won't have to. It remembers contexts: What you want is either #2 or #3 below: In view mode, if you haven't searched for any media, if you click on 'edit mode' button, you will be taken to edit screen for the media type you were viewing, with the first media selected to edit. So, if in view you were on 'all' menu, you will be taken to 'all' in edit. If you were on 'image' in view mode, you will be taken to 'image' on edit mode. If in view, you'd searched for media and got back some results, if you then clicked on 'edit mode' button, you would be taken to the edit screen for only those found items, shown one media at a time with pagination. If you got back only one result in the search, you would be taken to the edit screen of only that result (without pagination of course) If in view mode you click on the title of a media, you will be taken straight to its edit screen, no questions asked See example GIF below In any of the above scenarios, clicking the view mode button will display the media you'd just edited. Edit mode: clicking on title of media in 'view mode' - (#3 above)
    1 point
  25. Currently working on an update with bug fixes, translatable links, and (hopefully) ajax refresh when new pages are added. I should have something ready tomorrow. Edit: Made a lot of progress this weekend but will need a bit more time to iron things out. I was able to get the field to refresh when the Add New modal dialog is closed, which works great for single item selects and allows you to select the new item without refreshing the page. However, for asm-style multi-selects, the refresh wipes out your existing selection when it reloads. Because of this I think that another approach will be required.
    1 point
  26. Video clip showing latest development...(note: previews of other types other than images are still a work in progress...)
    1 point
  27. Greetings, A lot of you probably already know about this, but just wanted to post here because I think it's really neat. The New York Public Library has prepared a page with free access to 187,000+ historic images, all in high-resolution. Check it out... http://publicdomain.nypl.org/pd-visualization/ Thanks, Matthew
    1 point
  28. I purely use CKEditor for text and text only. And only allow a few HTML tags. Mostly h2, h3, h4, then p, strong, em, ul, li and a. I disable the pwimage, table and all other thing not related to pure markup text. All other content could be added with a page table field row. So if they need a form, a map, an photo album, a single photo or something else, they can add it via the page table. All rows of the table are looped and set to a variable. That variable is set to the template and rendered on the main view.
    1 point
  29. I'm not sure. This would involve an inputfield that allows for <optgroup>. I've read that this should be possible somehow with InputfieldSelect but i've yet to read how exactly this could be done. More info here: https://processwire.com/talk/topic/11348-select-input-field-with-opt-groups/
    1 point
  30. Sidenote In my experience simply truncating text to a hard limit to make summaries or intro text,rarely gives good results. If possible i would always choose for a designated summary/intro field. This just gives you more control and options and will probably save some headaches in the long run.
    1 point
  31. It's easy Add to any page if ($user->isLoggedin()){ //get link with current page id echo "<a href='/logout" . "?redirect=$page->id" . "'>Logout</a>"; } To logout.php <?php //get page id from input $redirect = $sanitizer->name(wire('input')->get->redirect); //get url from page id $url = $pages->get($redirect)->url; if($user->isLoggedin()) $session->logout(); $session->redirect($url); ?>
    1 point
  32. Depends a bit on context, but especially for modules I prefer translating strings in module file, storing them in $config->js and then in JS file fetching from config var. Simple example: PageListPermissions.module => PageListPermissions.js (though I'd also suggest "namespacing" JS config content, i.e. instead of using config.i18n.*, use config.YourModuleName.* and/or config.YourModuleName.i18n.* etc.)
    1 point
  33. Oneliner alarm <?php if(!$session->noPop) include("./popup.inc"); $session->noPop = 1; ?> No intendation
    1 point
×
×
  • Create New...