Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/01/2022 in all areas

  1. I have worked with a few multilanguage sites in ProcessWire and always found it so easy. We recently took on a WordPress site with multilanguage and wow, what a difference. I appreciate its all about the plugins that were chosen, but the plugin used is in the top 2 and it is so clunky. An entry for every language, so you have to upload the same images for every language just to change the text (I know there will be better ways to do this when you dig deep, but I am talking out of the box). Well done @ryan, when the next multilanguage site comes up I will always be confident in what we use.
    9 points
  2. We recently launched DOMiD Labs, a new microsite for our existing client DOMiD. We already built the main site for DOMiD in 2019, as shown in our previous post here and featured in ProcessWire Weekly #296. The new DOMiD Labs site belongs to a project to plan participative museum concepts for the upcoming migration museum in Cologne, Germany. Concept, design and implementation by schwarzdesign - web agency in Cologne, Germany. Featured in ProcessWire Weekly #433 We're using an in-house starter project to bootstrap new ProcessWire projects. This allows us to deliver smaller projects on a low budget while still providing an extensive, modular content system and to spend some time polishing the features our clients care about. Notable features of the site include: A modular content builder utilizing the excellent Repeater Matrix field. A blog area with a paginated news index page. Multi-language support (site available in English and German). Q&A sections using accordion elements. A contact form built with the Form Builder module. Fully configurable navigation and footer components. Custom translation management for interface translations. Learn more: domidlabs.de
    3 points
  3. Yes I fully agree with that. The CKEditor is used by many in Processwire - and keeps having returning questions about cumbersome to find configurations - we should setup a central place to first collect the useful configuration finds that are now spread over the forum, and then make them for all easy available. For the love of processwire I will start with this in the coming weekend.
    2 points
  4. I was in the need for using this module together with background images too - but in the "classic" way without any components. I am using the famous Lazysizes JS Plugin for lazyloading the images. To create responsive background images with the PageImageSouce module I also included the lazysizes bgset extension So the code in my template file looks like this: <div class="img-title-wrapper lazyload" data-sizes="auto" data-bgset="<?php echo $image->size($imgFormat)->srcset() ?>"> /* your content */ </div> The wrapper element then gets it's height either via CSS (height: 100vh for a big introduction title image) or through the elements inside the container. Adjust the background image styles to your needs (e.g. background-size:cover).
    2 points
  5. ProcessWire Concatenate Fieldtype Fieldtype that concatenates the values from one or more other fields at runtime. The value can contain additional formatting and/or words as needed, which you define in your Concat field settings. Example Problem: Your system has a first_name and last_name field, and you want to have a separate full_name field composed of first_name and last_name, without redundancy. Solution: You would create a new Concat field, click the details tab, and enter "first_name last_name" (the fields you want to concatenate) in the settings. Other Potential Uses Having a field that combines the value of two or more others, without the redundancy of separately stored data. Defining a custom “label field” for select boxes, like those used with the Page field. Defining a custom label for your Page List that includes your own formatting. Defining an alternate variation of a text field that uses a different text formatter. Considerations The value for this fieldtype is generated at runtime and thus no data is stored in the database. This is good because there is no duplication. However, it also means that you cannot directly query a Concat field from $pages->find(), for example. If you happen to change the name of a field being used in a Concat field, you will have to update the name in your Concat field settings as well. By design, Concat fields do not inherit the text formatters of the fields they concatenate. You define these separately with the Concat field. Because this is a runtime-generated field, there is no Inputfield associated with it. How to Install Install the module by placing FieldtypeConcat.module in /site/modules/. Check for new modules on the Modules screen in the ProcessWire admin. Click Install for the Concat Fieldtype. How to Create a Concat Field Under Setup and Fields create a new field using type Concat. After entering the new field name and label, click Save. Click the Details tab and enter one or more field names. Separate them with whatever spacing and punctuation is appropriate. Optionally choose one or more Text Formatters. If you are not sure which, “HTML Entity Encoder” is a good default to use. Save. Add your new field to one or more Templates. How to access the value of a Concat field This is no different than accessing the value of any other field. If your Concat field has the name “full_name” then you would output its value like this: echo $page->full_name; Download PW Modules Site: http://modules.proce...eldtype-concat/ GitHub: https://github.com/r...FieldtypeConcat
    1 point
  6. @Robin S thank you so much for your detailed answer! Your solution works nicely thank you , I have been wondering if using an ajax function would be a smart idea to prevent seeing the group-post page at all... I will give it a try shortly but will keep this solution in case I can't make it.
    1 point
  7. Thanks everyone. This works great. I thought I'd have to make something much more complex. <?php echo "<a href='" . ($page->prev("template=staff-detail")->path ?: $page->siblings("template=staff-detail")->last->path)."'><i class='fas fa-arrow-left'></i></a>"; echo "<a href='" . ($page->next("template=staff-detail")->path ?: $page->siblings("template=staff-detail")->first->path) . "'><i class='fas fa-arrow-right'></i></a>"; ?> The colon in the two echo statements seems to be some kind of shorthand for if/else. I hadn't seen it before so thanks for the tip. ?
    1 point
  8. Ah, nice, definitely! I was hesistant to use the WireArray first() and last() functions, because I wanted to avoid loading all siblings. Not sure if that’s really a concern, though?
    1 point
  9. I don't think there is any module that does exactly what you're asking about, but I expect it wouldn't be that hard to achieve without needing any module. We probably need to hear a longer explanation of what you're wanting to do. If the pages of the "book" can be grouped together in the tree in the form... Book title - Chapter ...or... Book title - Chapter -- Subsection --- etc ...then you can create your navigation links using $page->children(), $page->next(), $page->prev() etc. Or if the pages are scattered throughout the site but need to be grouped together for use in a book then you can use a Page Reference field to select all the pages that make up the book. As the book is browsed you can keep track of the fact the visitor is viewing the pages as a book by passing a URL parameter on each navigation link like ?book=my-book-title and this will let you work out the previous and next pages for use in the navigation. If you want to divide the long text into multiple pages on save then you can use a Pages::saveReady hook to parse the HTML and find the tags that you want to split on, then create new pages with the split content using the API. Or if you want to keep the long text in one piece but paginate it on the front-end then you could take a look at TextformatterPagination.
    1 point
  10. I don't think FieldtypeComments will be able to support those because they require their own dedicated fieldtypes to hold the data. So you would need to create a custom form to handle those, and if the images / page reference needs to be connected with individual comments then you probably need a totally custom comments implementation where you use a page-per-comment behind the scenes. But coming back to the original issue: one way you could work around this is to list all the comments on the parent page, but if a person wants to add a comment they click a link to submit the comment on the child page. If that child page should only be used to submit a comment and not to display any other information then you could use a URL parameter (or alternatively a URL segment) in the link and if the page is loaded without that parameter it redirects back to the parent page. So in the parent page template: <?php foreach($page->children as $child): ?> <h3><?= $child->title ?></h3> <?= $child->comments->render() ?> <a href="<?= $child->url ?>?submit_a_comment=1">Submit a comment</a> <?php endforeach; ?> And in the child page template: <h3>Submit a comment</h3> <?php // Show the comment form echo $page->comments->renderForm(); // If the submit_a_comment URL parameter is not present then redirect to parent page // This must go after the form render so that comment submissions will be processed before redirecting if(!$input->get('submit_a_comment')) $session->redirect($page->parent->url); ?>
    1 point
  11. Today I needed to implement a background image with sources, using the new UIkit Image component implementation: https://getuikit.com/docs/image#picture-sources PageimageSource doesn't do this out of the box, but I found I neat solution, which I thought I'd share: <?php // $bannerImage = Pageimage; preg_match_all('<source\ssrcset="(.*?)"\ssizes="(.*?)"\stype="(.*?)">', $bannerImage->render(), $matches); $sources = []; foreach($matches as $index => $match) { if(!$index) continue; foreach($match as $i => $v) { if(!isset($sources[$i])) { $sources[$i] = []; } $sources[$i][[ 'srcset', 'sizes', 'type', ][$index - 1]] = $v; } } echo '<div class="uk-background-cover" sources="' . $sanitizer->entities(json_encode(array_values($sources))) . '" data-src="' . $bannerImage->url . '" data-uk-img></div>'; This assumes that the render() function is returning a <picture> element. Cheers, Chris
    1 point
  12. Hi @wishbone I fully understand your feeling. I came from a non coder background, too. If you are willing to pay for a working contact form. I suggest you to buy Ryan's FormBuilder. Gideon
    1 point
  13. Try instead: template=faq-category, parent=page.parent.parent, sort=sort
    1 point
×
×
  • Create New...