Jump to content

Autofahrn

Members
  • Content Count

    187
  • Joined

  • Last visited

  • Days Won

    3

Autofahrn last won the day on March 20

Autofahrn had the most liked content!

Community Reputation

208 Excellent

About Autofahrn

  • Rank
    Sr. Member

Contact Methods

  • Website URL
    http://www.team-tofahrn.de/en/

Profile Information

  • Gender
    Male
  • Location
    Germany

Recent Profile Visitors

419 profile views
  1. Are we talking about dynamically updating the menu on client side (AJAX driven site) or producing different output from your template? In you template code you simply do not output the a tags for the "current" item to make an entry not clickable. Something like: foreach($languages as $lang) { if($user->language == $lang) echo "<li class='ActiveClass'>{$lang->title}</li>"; else echo "<li><a href='...'>{$lang->title}</a></li>"; }
  2. is there a 'not' missing? You still may use a repeater for your purpose, there is no need to output repeater's content in consecutive blocks. Never tried it, but a repeater effectively is a WireArray and should provide the method getIterator(). So in your output code you may fetch the first element whereever you like to place it, fetch the second later etc. If the content of the separators repeat over pages, you may also use a completely different approach and manage those separators as individual pages (with an own template) in some hidden section of your pagetree. On your "content" template you simply place a field of FieldtypePage (named Page Reference) and point to the separator to use. You still need two such fields, one for the header and one for the footer. Downside is, that the separators are managed separately. There are so many options, but I'd still prefer RepeaterMatrix for such purposes. And when I say "for such purposes" I don't mean to only define the separators with a RepeaterMatrix but the complete page layout (including text content, images, rows of blocks etc.. That way you are able to control layout, section order etc. from the GUI and do not need to modify PHP code for each change.
  3. Interesting, when I looked before, there were none. Now some are broken: Maybe something happens right now behind the scenes...
  4. You can not determine in .htaccess if a user is logged in. If you want to redirect "anonymous" users to somewhere else, then I'd place that into _init.php. Something like: if(!$user->isLoggedin()) $session->redirect('PlaceUrlHere');
  5. Am I the first to notice that some screenshots in the shop are gone? https://processwire.com/store/pro-fields/repeater-matrix/
  6. Guess this is the result from the lazyload which simply copies the data-srcset into srcset. Did you check the page source (as received from server) or DOM tree in inspector?
  7. Just wrote the same... Sadly the ProFields description currently miss screenshots, so its probably little difficult to get an idea about how RepeaterMatrix works. https://processwire.com/store/pro-fields/repeater-matrix/ With the RepeaterMatrix you basically define a sequence of elements producing content for your page. Each element has one or more field(s) containing stuff like images, text or whatsoever. Items may also have a "depth", which could map to div containers, for example. Here are two screenshots how this may look in the backend: : The second one generates this page: https://www.team-tofahrn.de/en/projects/organ-story/
  8. Fields can only be used once per page, this is mainly by design. But your template may have multiple fields from the same fieldtype (like image1 and image2). If you need multiple instance of the same field(s), you may use a repeater (or Table, Multiplier or RepeaterMatrix from the ProFields).
  9. So what is $page actually? Is it a category or subcategory (which does not have children)? As I pointed out, the or operator only must be specified when on a category. You may need to code like this: $pageSelect = "$page"; // page ID as a string if($page->hasChildren()) $pageSelect .= "|{$page->children}"; $selector = "template=product, limit=10, categories=$pageSelect, sort=$sort_results"; So $pageSelect would either look like "1234", if $page refers to a subcategory or "1456|1701|1702|1703" if its a category.
  10. Shouldn't this work with: $selector = "template=product, limit=10, categories={$page}|{$page->children}, sort=$sort_results"; Given that $page is either a category or subcategory then $page->children is either the list of subcategory pages or empty. Maybe the or operator must only exist when children exist (not tested).
  11. I wouldn't even think about such an invitation for performing dangerous things through a regular get request like invoking "any" templatefile. If you wish to generate different output depending on a get parameter you are of course free to do so (there is $input->get() to easily retrieve get parameters). Just call a function or execute another conditional block in your template.
  12. Autofahrn

    Tofahrn Foto

    I've finally managed to to remove my 1.5 decades old, all-ugly, frame-based photography site to something more modern. So what looked like this for a much too long time: now present the images much better, has a consistent layout and finally is responsive: The intention of the site is to provide some inspiration for the ambitious photographer and also provides a tips section focusing on some aspects of digital photography. After being idle for too long, I feel new motivation for adding even more tips as time allows. We'll see. https://www.tofahrn-foto.de/en/ Layout is basically pure UiKit and all content (including menu and footer) is managed using my RepeaterFlex as a kind of real world test. The RepeaterFlex is inspired by the commercial RepeaterMatrix fieldtype but uses plugins to define item templates (in case you're interested, there is a small Demo Site for RepeaterFlex including some documentation). The site uses lazy load of images (lazysizes.js) and page transistions (barba.js V1) to obtain a hopefully smooth experience. There also is ProCache running to deliver minimized css and markup. Enjoy.
  13. What about: if($image->width > 9000) $image->size(9000, 0, $defaultOptions); I'd anyway prefer something generic like (You'll probably want to account for landscape and portrait as well): $imgWidth = $image->width; while($imgWidth > 400) // Larger than minimum? { $imgWidth /= 2; // half size (or whatever factor) $image->size($imgWidth, 0, $defaultOptions); } Not sure about the ImageMagick quality setting, but "max" quality of a JPEG normally relates to its (I'll name it) "cluster" size. The higher the quality setting, the smaller the cluster is. This has nothing to do with "keep quality from original", which may be encoded with a lower quality setting, which seems to be the case in your example.
  14. Indeed, sounds complicated. But since you can do anything using the PW API, I don't see a reason why this shouldn't work with a custom solution. But there probably is no module which could be used out-of-the-box.
  15. You'll need a hook, something like this: maybe along with:
×
×
  • Create New...