Jump to content

Search the Community

Showing results for 'template'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. @cb2004 Probably just regular markup regions would handle that just fine. Unless I misunderstand, I don't think you'd need file regions for that. Where file regions would be helpful is if you wanted to keep all that repeater matrix output code self contained, perhaps in your repeater matrix template file. Like if you had certain CSS and/or JS that was just for that repeater matrix stuff, you might find it easier to build and maintain longer term if the output code is all kept together, rather than spread across different files. That's one thing I find file regions particularly helpful for so far.
  2. @ryan looks amazing to me. I use region("gallery", true) or similar in repeater matrix files and then do some logic in _main.php currently. Guessing this could replace that, or do markup regions not look that deep within repeater matrix template files?
  3. Good catch. Definitely an oversight in the template code itself. The old version does not wrap all elements in an anchor tag. Comparable example.
  4. Thanks, @teppo! This is cool reminder about the Wireframe::page() function. This is super useful to render repeaters as part of another page. I am rendering RepeaterMatrix page for a login (another take on this one). So I was hoping to create a controller and set of views for a RM page to separate the logiс. I cannot use a dedicated page for this. I am wondering, maybe there is a way to render custom content Wireframe way without being tied to a page? I am in a PageRender hook trying to change the output for the unauthorized. Would like to render custom view in a custom layout without a page (and a template). Now I try to have this stuff in another template's controller in a url segment handler. But this doesn't feel right)
  5. Thanks @Robin S I will try this and report back. It might not be for a week or so as I have another project to finish first. To be honest, in all my years of using ProcessWire, I have never really worked with access control at the field level, only the template. But it seems like this is the kind of quick, simple and elegant solution you would expect from ProcessWire. I'm glad I posted here as my solution was way too convoluted! 😉
  6. @DrQuincy, responding to the title of the topic: PW allows for access control at the field level as well as the template level. I don't think you need to do anything special with repeaters or child pages to achieve what you're describing. In your template settings: Do you want to manage view and edit access for pages using this template? > Yes Allow view access for "guest", seeing as you generally want the page to be viewable by everyone. Prevent direct access to file assets owned by pages using this template? > Yes always, regardless of page status or access control In the fields listing for the template, click to edit the files field in template context. Enable access control for the field and remove view access for "guest" (and any other roles who are not allowed to view the files). Now guest users will be able to view the page, but not access the files.
  7. @Ivan Gretsky Just use Page::render $wire->addHookBefore('Page::render', function (HookEvent $event) { /** * @var Page $page * @var WireInput $input */ $page = $event->object; $input = $event->wire()->input; // Use get method: // example.test/about?segment=home $segment = $input->get('segment'); // Allow template url allow segments otherwise you will get 404 error $segments = $input->urlSegments(); // Validate by template $page->template->name != 'home'; if ($segment === 'home' || $page->template->name != 'home') { /** @var Page $home */ $home = $event->wire()->pages->get(1); $event->replace = true; $event->return = $home->render(); } });
  8. Good day @teppo and fellow wireframers. I would like to render RepeaterMatrixPage items with wireframe. Tried to do it the regular way by adding wireframe as an alternative template file to their system templates and creating a contoller. But that didn't work out. Just maybe it is easy to achieve with some additional hook?
  9. Thanks for that, and what a happy coincidence! I'm not sure I want to edit the core at this point but I appreciate your code snippet. I think my other idea is going to take a bit more work but can be done with hooks: Create a child template with access control and file field Add Integer Unique field to store parent page ID Add Pages::save hook to create and save child page (check for its existance first and create a new one if needed) Add a ProcessPageEdit::buildForm on the parent template to add the access controlled field to the edit form Add a Pages::delete hook to delete the child page when the parent page is deleted I think that should do it. I'll have to try it out though. I was hoping there'd be a simpler solution!
  10. Funnily I tried exactly this yesterday and no unfortunately it doesn’t work because the repeater will check the access control of the page holding it. However it could a request to add a line to check if its access control is on, something like: public function getAccessTemplate($type = 'view') { if($this->template->useRoles) return $this->template; $p = $this->getForPageRoot(); return $p->id ? $p->getAccessTemplate($type) : parent::getAccessTemplate($type); } I tried and it worked but it wasn’t a fit in the end for what I was trying to achieve.
  11. In a template you can enable: Prevent direct access to file assets owned by pages using this template? And in site/assets the folder of that page has a minus prefix added so Apache tells PW to handle the file request. I have a situation where I want the top level page to have no access control but I also have a series of files where I need access control. I.e. it's a mix. I'm just wondering if I make the files be part of a repeater, can I set access control for the repeater only since it has its own ID. Will this work? I would guess that it does but I wanted to see if anyone has used this approach in production.
  12. Hi @virtualgadjo, thx, yes, drag and drop is possible. I meant something like sorting the files alphabetically for example. Or by name etc. Just like you do it template based in the page tree. have a nice day too 😉
  13. This module is so handy. A minor thing, but I find myself not being able to differentiate between fields when selecting them: It would be great if there was an option to show field Names instead of Labels (or show both). Obviously I can rename my fields, but I like to keep them short for the client, and want to avoid the complication of using template overrides.
  14. Hi again 🙂 actually, all those fields are not available in an image field by default but become so when you associate a specific template to the given image field say for example you have an image field named myfooimg if you create a template named field-myfooimg all the fields you use in this template will be availabe for you image datas, text, list of radio/checkboxes and so on... have a nice day
  15. Hi when it comes to a "select" just install the select options module which is in pw by default and then when adding a new field you'll be able to choose when it comes to images, having a close look at the full article from which the image you show comes https://processwire.com/blog/posts/pw-3.0.142/ you'll see that it relies on a template you create witjh a given naming convention --- quote--- Rather than trying to come up with some new way of defining custom fields, you define the custom fields for your file/image field with a Template. Simply create a template having the name "field-[name]" (replacing "[name]" with the name of your file/image field), add fields to it, save, and that's it. It's okay to add fields that might duplicate those already on your regular page template, as the fields for files/images are properties of each file/image rather than properties of any page. ------- not only will you be able to use radio button but nearly any kind of fields you would like to associate to the image hope it helps a little 🙂 have a nice day
  16. Thank you Jurgen. By comparing your template with my code I see what I did now. I copied a template you created on 15.02.2023 but somehow I'd deleted the line '<p>[[TITLE]]</p><ul> from $body. Dur! Thanks again.
  17. Field Access A Process module that provides an overview of field access settings, including template overrides. Usage The table has a sticky header so that the columns can be understood when the table is scrolled. The empty space underneath the table is to allow scrolling to the bottom of the table. There are fields for filtering the table by field name or by template name. The field names link to the Access tab of the field settings, and the template names link to edit the access settings for the field in the context of that template. A collapsed field at the top of the page has information about the meaning of the table column headers, and tips for understanding the values in the table: Table column headers Control: Is access control enabled for this field? View: Roles that can view the field Edit: Roles that can edit the field Show: Show field in page editor if viewable but not editable (user can see but not change) API: Make field value accessible from API even if not viewable Overrides: Overrides of the field access settings in template context Tips If the guest role has view access then it means that all roles have view access. You can hover the guest role in the View column to see a tooltip with all the role names if you want a reminder of those. Overrides: when access control is enabled as a template override, the Control, View, Edit, Show and API columns only display settings that are different from the field access settings. If a column is empty it means the field access setting applies. https://github.com/Toutouwai/ProcessFieldAccess https://processwire.com/modules/process-field-access/
  18. Hi ausblick, I'm happy to answer your questions. Basically, these are topics that for the most part don't specifically concern PAGEGRID, but rather ProcessWire in general. In ProcessWire, site profiles are essentially preconfigured starting points for a new site. They define the structure, templates, fields, and sometimes demo content that get installed when you first set up ProcessWire. Unlike themes in WordPress, which can be changed later, site profiles are installed together with ProcessWire when you first setup the site and can't be changed later. PAGEGRID supports the creation of site profiles, and there are currently two smaller PAGEGRID profiles that can be installed (click the thumbnail to see the frontend). However, these are currently only available in PAGEGRID Cloud. If you want to try them quickly, you can create a free cloud account. Cloud sites can then also be exported as a site profile (with a self-hosting license). But I can also upload them here as ZIP archives if you prefere. For my projects I usually don't use site profiles. Since PAGEGRID allows you to install pre-built blocks (which create all the templates and fields for you), it's already a good starting point for a new website. All you have to do is add the blocks you want to your page and design them using the style panel (visually) or with CSS code. Since my websites usually look very different from each other, I prefer blocks that are largely unstyled by default. Yes. Procache works with PAGEGRID. But it is not really needed since PAGEGRID is already using markup cache for all it's output. If you build a site that is mostly rendered through PAGEGRID it will be very fast out of the box, without any additional customisation. E.g. page-grid.com which is build with PAGEGRID has a performance score of 100 (best score) in Google lighthouse speed test and is not using any additional caching. First you have to add a PAGEGRID field to your home template inside the admin. Then open the file home.php inside your site/templates folder and add the following lines: <div id="content"> <?= $pagegrid->styles($page); ?> <?= $pagegrid->renderGrid($page); ?> <?= $pagegrid->scripts($page); ?> </div> Note in this example I am using the blank site profile and markup regions are enabled. The #content div in this file will replace the #content div in _main.php See the Markup Regions documentation for more information.
  19. Hi Juergen I have the new title property set - ->title('<h1>From LPN website contact form</h1>') // this is a new property from this module but it does not show up in the email. I've read your docs where you say "This will be added automatically to the email, independent if you are using a HTML email template or not - no need to add it manually." so I'm puzzled. Thanks for a great module
  20. Hey everyone, we just released a small companion module for StripePaymentLinks: 👉 GitHub: https://github.com/frameless-at/StripePlCustomerPortal PW Repo: https://processwire.com/modules/stripe-pl-customer-portal What it does The module auto-creates a ready-to-use page at /account/ where logged-in customers can: view all their purchases (table or grid view) access their purchased products / membership pages update profile data (name + password) open Stripe’s Customer Portal to download invoices or manage subscriptions No custom template coding required — the module installs a template + page, and you can still override the markup if you want. ⸻ Why we built it StripePaymentLinks already handles the checkout & user/purchase creation. This module completes the loop and gives customers a proper account area. 💡 Bonus benefit (Marketing): The grid view not only shows purchased products — it also shows available-but-not-yet-purchased products in greyscale. This turns the account page into a soft upsell area without being salesy. ⸻ Requirements ProcessWire 3.0.210+ StripePaymentLinks module installed & working Stripe Billing Portal must be enabled (Stripe → Settings → Billing → Customer Portal) ⸻ Status 🚧 BETA — already used on live sites, but we’d love developer feedback. If you try it out, please tell us what works and what’s still missing. Issues / PRs welcome. ⸻ Cheers & happy coding, frameless Media
  21. Dear community, I am searching for a solution to show the items of a repeater field in the link dialog window. More in detail: the items of repeater_1 (Repeater field) should be selectable in the link dialog window of text_1 (TextareaLanguage/CKEditor field). The two fields are located in the same template. The repeater items should be selectable just as you normally can select pages. Any suggestions? I would really appreciate your help! Best Nomak
  22. I only have two guesses based on what you've shown: The $page->images isn't actually referring to your images' fieldname? Make sure that the name of your template's multi-image field is actually called "images". If not, change $page->images to whatever the field name is (so if it's named "pictures", use $page->pictures). Enclose the attribute properties in quotes. It may not be a problem for the source, but it would definitely be a problem for a proper ALT value. BAD: <img src=http://example.com/image.jpg alt=This will break your HTML /> GOOD: <img src="http://example.com/image.jpg" alt="This will NOT break your HTML" />
  23. Hi All, I'm trying to create a simple gallery using the popover feature. Clicking (or touching) a thumbnail would show the large picture in the popover. See this codepen for a (reduced) example. In this case the triggers are just buttons (of class "trigger") lined up, each having a thumb image as child node. The popover image property src is populated via the data-full attribute of the button. This is working fine. But in my real use case the thumbnails are created in the template via a foreach loop: <article class="gallery"> <?php foreach ($page->images as $image){ $thumb = $image->height(180); echo "\n <button class='trigger' popovertarget='mypopover' popovertargetaction='show' data-full=$image->url > <img src=$thumb->url alt=$thumb->url /> </button> "; }; ?> <div id='mypopover' popover> <img src='' alt='uups' /> <button class='close_pop' popovertarget='mypopover' popovertargetaction='hide'>&times; </button> </div> </article> And here the src attribute results empty, the alt value remains 'uups'. I presume it's a scope issue of the variables in the function initGallery(). What am I doing wrong? Any hints are very welcome! Kind regards ottogal
  24. I'm working on a site where I want people to be able to create listings but to do so they need to create accounts first. For the login/register forms, I'm using https://github.com/ryancramerdesign/LoginRegister but it says in the module settings "Roles with page-edit permission are not shown." But I want my new users to be added to a role with page-create/edit permissions for the template in question, so how do I assign that role to the module? Or is there another way I should be doing this?
  25. I haven't tried the template caching quite yet but it's on my 'discovery' to-do list for sure!
×
×
  • Create New...