Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/13/2015 in all areas

  1. Hello there! I'd love to publish my first ProcessWire module. Please let me know if you have any thoughts regarding the quality, documentation or new features you would like to see. See Github page: https://github.com/MartinMuzatko/TextformatterAutoAnchor/ ProcessWire Module: http://modules.processwire.com/modules/textformatter-auto-anchor/ TextformatterAutoAnchor Automatically add anchors and IDs to Headings What is it doing? This Textformatter adds an id attribute to every heading with a slug of the text. Intended for easily creating linkable sections. Demo Currently it is used at http://www.happy-css.com AutoAnchor in action: http://happy-css.com/lessons/riotjs/reusable-components/ Preview can be seen on Github Configurable Variables Heading Selector Determine which headings you want to have the ID + anchor Use a regex-like range or list, e.g.: 2-6 or 346. Anchor Class Your css classes that are attached to the anchor link. Anchor Content The text for your anchor. If you prefer an icon, you could also use HTML for example. What are the Alternatives? There are existing tools like Anchorific JS but its dependency is jQuery. I love to have an alternative that is PHP only. Known issues Anchors are placed in front of the text. This could be a future configurable setting. The slug is also not configurable yet, currently it is lowercased and space is replaced with hyphens/dashes
    9 points
  2. I just installed the profiler on a local vagrant machine without problems. Yesterday after installing xdebug my site even timeouted for load intensive sites, which drove me nuts, but the profiler really does not intervene in load times at all. I've a profile from an edit page in the backend for anyone interested in how these profiles look like: https://blackfire.io/profiles/ed0fddee-769f-469d-9776-d1172445217e/graph Edit: Might be gone in 24h as the free plan does store profiles only for a day.
    3 points
  3. You can fake the PageArray, that the pagination is based on. $pa = new PageArray(); $pa->setTotal($total)->setLimit($limit)->setStart($start); $pager = $this->modules->get('MarkupPagerNav'); $pagination = $pager->render($pa);
    3 points
  4. In ProcessWire we have Hanna Code and it uses almost the same syntax as in MODX except those are snippets and chunks in one. Hanna code runs from disk, while MODX snippets are eval()'t. (is that a good word ? ) You could also create a page with a footer template and just render that page in your template with $yourpage->render(). After a while you will discover more options to do things, just give your self the time .
    2 points
  5. Depending on your setup, you could probably make use of the "Custom PHP code to find selectable pages" option and reference the $page->parent or $page->parent->parent - hopefully you get the idea.
    2 points
  6. check .htaccess principal functioning with a call for phpinfo dump from your (relative) root RewriteBase /name of subfolder/ ok ? emedded space in the alias/directory name ? permission error in .htaccess file ? relative/absolute links ? httpd.conf 'AllowOverride All' ? mod_security in your CPanel ?
    2 points
  7. Just hitted this myself. Should all languages be active from API by default? That would be in line with how it functions in admin.
    2 points
  8. InputfieldChosenSelect This topic (https://processwire.com/talk/topic/71-categorizingtagging-content/) showed the need for a Inputfield that would provide a real tagging UI to be useable with FieldtypePage. It uses the chosen library, which can be found here http://harvesthq.github.io/chosen/. It's meant for MultiPageFields and works kinda like asmSelect, but with a different skin. Features: Inline adding of new tags, which will then generate the corresponding pages. Sortable tags. Usage Install the Module Edit your pagefield and choose InputfieldChosenSelect as inputfield. Use Enter or Tab to create new Pages with the currently typed name. Enter will fill in the tab currently selected in the dropdown. http://modules.processwire.com/modules/inputfield-chosen-select/ https://github.com/LostKobrakai/InputfieldChosenSelect
    1 point
  9. For your "typical example" of "the contact info in footer area", you can, for example, just: create a Contact information page (that is hidden), insert <?=$pages->get('/contact-info/')->body?> wherever you want in _foot.php, or elsewhere. That's it. The content editor edits the body field of the Contact information page. There's no need for a template for this page normally. If you define (in _init.php, for example): $contact_info = $pages->get('/contact-info/')->body, you just have to use $contact_info wherever you want. It could be anything of course. Not just a CKEditor textarea body field.
    1 point
  10. How about simply hooking saveReady and saveFieldReady and call the same function?
    1 point
  11. It isn't imported that the timestamp match the exact time, the "Rename on Save" function did the trick! Thanks a lot!
    1 point
  12. If my screenshot is what you want to achieve, then it's very easy. Here are the settings for the details tab of the field: And here is the page tree that is being referenced:
    1 point
  13. That is basically correct, but the timestamp will also be included in the filename of the cropped version. Is it important that the timestamp is updated to match the exact time the image is actually cropped? The "Rename on Save" option might work - haven't tested.
    1 point
  14. There are many former really great modx members out there in this wild hood... Very warm welcome to your own new journey to redefine your thinking and workflow.... Please use google to search the forums (this the only con of this forum) to get more and better information about the force of PW! Best regards mr-fan
    1 point
  15. $pageArray = $pages->find("id=3922|2394|2341"); Should've reloaded before posting, but both ways work
    1 point
  16. Hi, $pageArray = $pages->getById("313|34|23|978"); Cheers
    1 point
  17. Thanks so much Adrian! Ok folks... just for anyone else who stumbles over here.... What I was trying to do was to use a single image field for 3 common things. The usual way would be to create 3 unique image fields. By using tags, i wanted to be more resourceful and keep it simpler by getting away with using just one image field. Now thanks to Adrian and SiNNut I have been able to do just that! What I needed... 1. Upload image/s for articles 2. Upload a single featured image for listings in other pages. Think YouTube video listings with the video thumbnails 3. Upload images to show up in an image gallery. In case 1 above, these images are untagged. In case 2 above, the desired "representative" image for the article is tagged with featured. In case 3 above, any image that is tagged with exclude will NOT show up in the image gallery. Where the problem lied originally was that if an image had more then one tag, I could not filter out what images I did not want. They all appeared! This was because I actually had an image that was both tagged 'featured' and 'exclude'. Adrian's last solution enables me to tag an image with exclude and even if the image has been tagged with something else, it still filters out the image from the gallery. Yay! Here is part of what I did.... it should provide you with enough to get the idea! foreach ($page->images as $image) { if (!$image->hasTag("exclude")) { // Adrian's Magico Any images tagged with exclude will not show up below... $thumbnail = $image->width(320); $content .= "<figure class='block thumbnail' itemprop='associatedMedia' itemscope itemtype='http://schema.org/ImageObject'>"; $content .= "<a href='{$image->url}' itemprop='contentUrl' data-size='{$image->width}x{$image->height}'>"; $content .= "<img src='{$thumbnail->url}' itemprop='thumbnail' alt='{$image->description}'>"; $content .= "</a>"; $content .= "<figcaption itemprop='caption description'>{$image->description}</figcaption>"; $content .= "</figure>"; } } Thanks to the ProcessWire Support team. All of you... World class awesomeness.
    1 point
  18. Here you go: http://stackoverflow.com/questions/13106299/redirect-using-htaccess-based-on-referrer Actually, that link I posted is part of the puzzle, what you might actually want (untested) is this since you know the referring domain: RewriteEngine On RewriteCond %{HTTP_REFERER} ^http://the-naughty-domain.com [NC] RewriteRule ^ http://the-website-of-your-choosing.com/ [L,R] Basically targetting only the naughty domain and sending them somewhere else. This can also be changed to do any of the other actions discussed in this topic.
    1 point
  19. There is a new development release of Processwire every week that you can download. The upcoming version 3 (currently in alpha) will allow for composer support and lots of other things. Its a good time to get involved. I made the switch about 6 months ago and I haven't looked back. I feel I have only just scratched the surface with what this system could potentially do.
    1 point
  20. In the past few days I rewrote FEEL as a module. I can say that it's more usable this way, and will be even more if it gets to the modules directory. Module settings makes it easier to adjust global options. The ability to override options on individual edit link was also kept. There may be some quirks in the module version but it's quite stable as it is. I tested it on 3 sites (single-lang and multilang) and seems to work fine. Notable changes: rewritten as a module, usage mode changed to $page->feel() array format for options (options can be accessed by their names) new option: "Enable module" - toggle module on/off globally new option: confirm iframe close if edit form has changed (only on Pages, uses the built-in admin notification message) fixed: wire("user")->language only available on multi-lang setups JS callback functions (still in WiP status) new: override options on individual edit links The new github repo is here: https://github.com/rolandtoth/FrontEndEditLightbox I'll keep the previous repo for historical reasons, with a big "unmaintaned" warning.
    1 point
  21. Thank you for confirming it's not built-in. IMO, it should be the default so as to be symmetrical w/ the admin UI.
    1 point
  22. I think it is still the case that you have to explicitly activate all languages when working with the api. More info and code in this thread. https://processwire.com/talk/topic/4383-how-to-set-language-active-via-api/ Like apeisa's last question suggests, it might make more sense if all langs would be enabled by default. Dunno if anything has been done about it, via a Github request or the like.
    1 point
  23. In case you want it a little more simpler $pages->setOutputFormatting(false); $pag = $pages->find("template=basic-page"); foreach($pag as $p) { foreach($languages as $lang) { if($lang->isDefault()) continue; $p->set("status$lang", 1); $p->save(); } }
    1 point
  24. Thanks! Just in case anybody else searches for similar things, here's a simple example $en = 'status' . $languages->get('en'); $us = 'status' . $languages->get('us'); $fr = 'status' . $languages->get('fr'); $pag = $pages->find("parent=1072, template='product'"); foreach($pag as $p) { $p->setOutputFormatting(false); // not sure if necessary here - I made it a habit to always include it, just in case... $p->$en = 1; $p->$fr = 1; $p->$us = 1; $p->save(); }
    1 point
  25. I understand that other CMSs have places where you might edit code in the CMS, and I also understand there is a convenience factor in many cases. But the main reason why I want to support snippets is actually to encourage sharing of code snippets. It's feasible that we can have a library of snippets that people can just paste in, and this is accessible to anyone. This is the area where I think the snippets may be worth the compromise of their downside. But I will do as you suggested and document why people might want to avoid using snippets for custom site-specific code, or plugging things into live sites. Thanks, Ryan
    1 point
×
×
  • Create New...