Jump to content

Choose custom repeater template


Sipho
 Share

Recommended Posts

Is there a module or plugin that is like a repeater but you can choose a template? I want something that let's me:

  • choose a template to get fields from,
  • display these fields like a repeater does
  • add new pages without adding a title or name (this might be achievable using other means like ProcessSetupPageName
  • delete pages

I feel like somebody might have already made a module that does just this, however, I haven't found any. Perhaps there is a way of doing this with a standard repeater that I don't know about.

Link to comment
Share on other sites

@bernhard I am aware of PageTable but it doesn't suit my needs. I want it to be editable directly on the page without having to click on a link to open a modal. Like a repeater does it. PageTable is exactly what I want apart from that. Sorry I didn't make that clear.

Link to comment
Share on other sites

@bernhard It won't be just simple text so handsontable is out. ListerPro looks interesting but still inconvenient and not free.

@adrian Can you choose a template for Repeater Matrices? From what I can gather it's the same as a repeater but you can have more than one 'field set'. The reason I wan't to be able to specify the template is because I want them to be actual pages that an end-user can visit. Being able to edit them inside a page without opening a modal is just for convenience. They should still behave as proper unhidden and non-admin pages. I could just use a PageTable but it is such a hassle.

Link to comment
Share on other sites

@Sipho - You can choose different templates for Repeater Matrix fields - that link I provided shows examples and states:

Quote

The types that you see there are configured with the field, and you can create as many different types as you want.

But, as with repeaters, they are not pages with URLs that can be directly visited - you could probably "fake" this by using URL segments on the parent page and use the passed values to determine which repeater item to show.

OT - I completely agree that the PageTable interface is not ideal - seems to me we need the repeater matrix editing interface for PageTable fields as well. When the PageTable field was added, repeaters didn't support ajax loading, hence the modal editing interface to ensure it was scalable with lots of items.

  • Like 4
Link to comment
Share on other sites

9 hours ago, adrian said:

OT - I completely agree that the PageTable interface is not ideal - seems to me we need the repeater matrix editing interface for PageTable fields as well.

+1
PageTable is in desperate need of a big feature upgrade. However, as it is a byproduct of Avoine's need and neither Ryan nor Avoine seems to be interested in pushing it any further, an organized community effort or better yet the very first "crowdfunding" in ProcessWire history could give it boost. I would be happy to join in the fun :) Maybe @teppo could help us by including this feature request in an upcoming poll of weekly.pw, just like he did with Import/Export.

Edited by szabesz
funding :)
  • Like 1
Link to comment
Share on other sites

50 minutes ago, szabesz said:

PageTable is in desperate need of a big feature upgrade

what features are you talking about exactly?

I'm using my DataTables Module/Field for all my Projects recently. It's a little bit more effort in the setup but a lot more powerful regarding display features. Though i have to admit that the mobile support could be improved...

I'm using links to pw-modals a lot for editing. So it's not real ajax-inline editing but i like how simple and versatile everything is.

59896e9e5f60f_2017-08-0809_50_45-Kontakte.thumb.png.83ba504296b9ba3a321f4effa483ae51.png

also a nice example:

but there is still a lot to do, so i'm curious what you guys think is missing for pagetables :) crowdfunding would be nice :)

  • Like 1
Link to comment
Share on other sites

Hi Bernhard,

I have not tried your module yet but I gathered that it does not support Page Reference and Image fields the way PageTable or Lister do. Am I right? Simply inputting non relational data is not what I normally need. Sure, there are lots of use cases for non relational data input but your module seems to be conceptually different from PageTable.

What I'm missing form PageTable is column sorting and Ajax editing. Even ListerPro is rather limited regarding Ajax editing an displaying PageArrays ( = fields of related pages ).

One last thing: for important features like this one, I prefer using core/Ryan's modules to anyone else's just because of possible compatibly issues in the future. Do not get me wrong, I do appreciate all the work you are putting into sharing your module(s), however I do not feel comfortable with relying on third party modules which cannot be removed without a lot of effort, should the module get unsupported in the future for some reason.

Edited by szabesz
typo
  • Like 1
Link to comment
Share on other sites

@szabesz I just want some simple AJAX editing for pages :'(. I don't mind about column sorting as much as this. For now I will just continue using PageTables with modal editing, as inconvenient as it is. I would also join in the crowdfunding to push this forward :)

@adrian I really wanted something that did make pages with actual URLs that can be visited. I don't really feel comfortable using Repeaters in that way. It's just not what they were designed for (I think). 

  • Like 1
Link to comment
Share on other sites

@Sipho adrians BCE could also be an option for you. you can also include the lister as field in the page editor:

@szabesz

totally wrong ;) it supports all fields - you just have to write your own return statement. that's what i was talking about: it's a little more effort to setup but it's a LOT more versatile. and it has column sorting and filtering onboard. also pagination of the results. for now it does only support ajax in one whole dataset. so tha pagination is done client side. that would have to be improved for large scale situations but it's totally doable.

for example an image column would be as simple as this: 

Regarding the core-topic: I totally agree and i think it would be awesome if @ryan could take a look at my module and think about adding this to processwire. For me this has been an invaluable benefit in my last years projects... but it's still too incomplete for public use and would need some tweaking regarding support of mobile devices and - even more important - large scale.

  • Like 2
Link to comment
Share on other sites

6 minutes ago, bernhard said:

totally wrong

Good to hear that! :D

6 minutes ago, bernhard said:

adding this to processwire

When doing so, we should make PageTable deprecated I think, and some migrating aid would be great too. Oh well, I'm just daydreaming I guess...

  • Like 1
Link to comment
Share on other sites

1 minute ago, szabesz said:

When doing so, we should make PageTable deprecated I think, and some migrating aid would be great too. Oh well, I'm just daydreaming I guess...

No reason for that i think. it's more an extended MarkupAdminDatatable + Fieldtype than a replacement of PageTable. PageTable is easier to setup and has it's place for other situations / audience.

Link to comment
Share on other sites

1 minute ago, bernhard said:

No reason for that i think.

Then let's "merge" them! I do not see why we would need two similar core modules. It takes extra time to maintain two. There is not enough time for PageTable to begin with, for example see just his topic. A simple enhancement for PageTable which might never find its way to the module :( I do not have the time and expertise to do it properly, that is why I opted for the JS hack, BTW.

Link to comment
Share on other sites

31 minutes ago, bernhard said:

adrians BCE could also be an option for you

@bernhard I don't quite understand how it matches what I described. Doesn't it only let you edit titles? To edit all the fields don't you still have to open a model like a PageTable? Maybe I am missing something. Could you explain how it could be used for what I described?

Link to comment
Share on other sites

3 hours ago, Sipho said:

@bernhard I don't quite understand how it matches what I described. Doesn't it only let you edit titles? To edit all the fields don't you still have to open a model like a PageTable? Maybe I am missing something. Could you explain how it could be used for what I described?

Here is the post with the Lister Mode screenshots: https://processwire.com/talk/topic/6102-batch-child-editor/?do=findComment&comment=100763

You can set it up to edit any/all fields using the Lister interface. The only problem is that it doesn't allow for adding new items/child pages.

 

3 hours ago, Sipho said:

@bernhard To clarify, I basically want a PageTable but with the repeater matrix editing interface as @adrian said.

Maybe what we actually need is to modify the repeater field to allow it to store pages under a specified parent within the page tree, rather than under Admin > Repeaters

  • Like 4
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By joeck
      Hi,
      I'm facing the issue where i have a repeater field with a multi language textarea (german & english, german beeing default). In german more blocks should be displayed as in english.
      The textarea field is configured as inherit default language if blank (I don't want to change this since it is the wanted behaviour for all other pages...).
      Now I want to access the unformatted value of the textarea field in the repeater and only show it if it is not empty. Something like this:
      $body = ""; $page->of(false); foreach($page->blocks as $block){ //blocks is repeater field, each block has title and textarea if ($block->textarea->getLanguageValue($user->language)){ $body .= <<<EOD <div> <div class='uk-card uk-card-default uk-card-body'> <h3 class='uk-card-title'>$block->title</h3> $block->textarea </div> </div> EOD; } } $page->of(true); print $body; However this doesn't work: Call to a member function getLanguageValue() on string.
      I also tried the other syntax for getLanguageValue:
      $page->getLanguageValue($language, $field) But I didn't manage to get a unique name of the textarea field in the repeater.
      I looked into the API of FieltypeRepeater but couldn't find anyhting that fixed my issue.
      Any ideas?
    • By opalepatrick
      I see old posts saying that repeaters are not the way to go in Custom Process Modules. If that is the case, when using forms (as I am trying to do) how would one tackle things like repeat contact fields where there can be multiple requirements for contact details with different parameters? (Like point of contact, director, etc) or even telephone numbers that have different uses?
      Just for background I am creating a process module that allows me to create types of financial applications in the admin area (no need to publish any of this, pure admin) that require a lot of personal or company information.
      Maybe I am thinking about this incorrectly?
    • By spercy16
      I was previously using individual fields to capture and output multiple cards onto my web page but after recently learning about repeaters would prefer to use this field type, as it will be a lot more user friendly for end users to create new cards. I tried to modify my code to grab the fields from the new Repeater field(s) but am getting this error message on the page:
      Here is the code I'm currently trying to use for the cards:
      <?php // https://processwire.com/api/arrays/ // check if the array of images has items foreach($page->tall_card as $card) { $count = 0; $count++; $options = array( 'quality' => 70 ); $image = $card->image; $img = $card->image->size(550, 400, $options); $cardHeading = $card->title; $cardBody = $card->plain_paragraph; $raised = $card->raised_amount; $goal = $card->goal_amount; $link = $card->link; if ($raised == 0 ) : $percent = 0; else: $percent = $raised_amount / $goal_amount * 100; endif; if ($percent <= 5) : $percent = 0; endif; ?> <span id="card<?php echo $count?>" class="card"> <img class="cardThumb" src="<?php echo $img->url; ?>" alt="<?php echo $image->description; ?> Thumbnail" /> <div class="cardBody"> <div class="cardText"> <h2><?php echo $cardHeading; ?></h2> <?php echo $cardBody; ?> </div> <div class="progressBarSection"> <progress class="progressBar" id="progressbar<?php echo $count; ?>" value="<?php echo $percent; ?>" max="100"></progress> <span class="raisedAmount"> $<?php echo $raised; ?> usd </span> <span class="goalAmount"> $<?php echo $goal; ?> usd </span> </div> <div class="primaryBtn"> <a href="https://www.paypal.com/donate?hosted_button_id= <?php echo $link; ?> &source=url"> <button> <i class="fas fa-donate"></i> Donate </button> </a> </div> </div> </span> <?php } ?> Thanks in advance for any help!
    • By spercy16
      Coming from Perch (CMS) to Processwire, the one major downside I've found is that every place I want to insert content into my pages requires a single field (be that an image, integer, string, etc.). This can be a real pain to setup and manage if you have a lot of pages, many of them with dozens of unique fields. For example, on the Projects page of a site I'm working on right now I have to have fields for donate_amount (1-15, meaning fifteen unique fields that I have to duplicate manually), goal_amount(1-15), card_body(1-15), etc. After using Perch for a while, the way their system works is simply easier. You instead create your fields in a single PHP template (for every unique section, like a card) and their CMS imports those fields into the CMS when you choose to use that card, then you just fill in the values. You can also choose to reuse that card multiple times and each one you add gives you the several fields you need to fill in. So you can easily add your 15 cards, each with a picture, title, paragraph, and link, etc. and each one is basically given a unique ID that you can reference in your CSS files. If there's any way to make fields and templates work more like that, it would be a truly outstanding and efficient CMS. The great advantage of the way Perch is setup is that I can make a card with 10 fields, if need be, and easily duplicate that card out 40 times if I need 40 cards on the page and wouldn't need 10 fields for 40 cards (meaning in PW I would need 400 fields). If there's an easier way to do this in PW I would love to know, but as of right now, from what little I do know about the CMS 400 fields would be the only way to set that up, and that would be much more time consuming than if I could create one card (in PHP) with 10 fields that automatically added a number to the end of each field for each card (if that makes sense).
    • By carlitoselmago
      It's been twice this year as a PW developer where clients have asqued me to have a way to put content on specific coordinates of a picture. Something like what image maps are made of. But not necesarly on links, sometimes text, sometimes images and links. 
      So I've been thinking to build an inputfield for that purpose. But I'm not sure how could it be the most flexible so I can share it in github/modules page.
      Ideally it would need to work like a repeater field where you start uploading an image and then adding any custom field like title, url etc. So the user could add multiple elements floating over that image.
      Does anybody here know the ideal way to start the arquitecture of something like that? I could just hardcode the fields I need for the website I have to code this month but it would be nice to be something more flexible.
×
×
  • Create New...