Jump to content

PageTableExtended admin layout


a-ok
 Share

Recommended Posts

Hi folks,

I've been using the PageTableExtended recently to create some dynamic/curated sections on my site which is working really well, functionality wise, but the admin layout in the CMS is a little odd to work with. I have attached a screenshot of how one of my setups currently looks. You'll see it's hard to know what 'flexible-content-block' is an image, or text, or embeddable media etc. What would be really useful is to see the 'page' title on this screen. I have attached a screenshot with an idea. So, is something like my proposal currently possible, and if not, could it be added to a feature list? Wordpress's ACF flexible content area use this type of setup and it's a lot easier to maintain and organise. Especially for clients/users. Or, is there a way which I can fork this and build this layout for others to use if they find it useful?

post-2553-0-78564500-1425645467_thumb.pn

post-2553-0-62042300-1425645729_thumb.pn

Thanks,

R

Link to comment
Share on other sites

Yep, definitely using the Extended version. But maybe it's to do with the 'Automatic Page Name Format' field? See my screenshots below. Any way to make the 'template label' appear as the type? Do you see what I mean?

Screen%20Shot%202015-03-06%20at%2014.31.

Screen%20Shot%202015-03-06%20at%2014.33.

Link to comment
Share on other sites

I managed to found out where it is outputting Automatic Page Name Format (flexible-content-block in this case) in the wire

protected function renderTableCol(Page $item, array $fields, $column, $width, $linkURL = '') {
    $out = $this->getItemValue($item, $fields, $column); 
    if($linkURL) $out = "<a class='InputfieldPageTableEdit' data-url='$linkURL' href='#'>$out</a>";
    $attr = $width ? " style='width: $width%'" : '';
    return "<td$attr>$out</td>";
}

So, where it is outputting the `getItemValue` can it not output the label of the template being used?

Ideally something like

$templateLabel = $template->label;
if($linkURL) $out = "<a class='InputfieldPageTableEdit' data-url='$linkURL' href='#'>$templateLabel</a>";
Link to comment
Share on other sites

Yep, definitely using the Extended version.

Sorry missed your point a bit, thought you wanted a more "descriptive" layout instead of only better titleing. backes already showed the part of the pagetable configuration, where you can change which rows should be visible. Just put title in the first line and you'll get the title there.

Edit: If you're talking about the title of the type of page use "template" or even "template.label"

Link to comment
Share on other sites

Thanks for the help. I have put title, but the title is automatically generated as I don't want the user to have to type 'Image' or 'Image' every time. I have hidden this from the editor by default (see attachment) I'd like the title of the type of page to be shown here.

Screen%20Shot%202015-03-06%20at%2015.21.Screen%20Shot%202015-03-06%20at%2015.21.

Link to comment
Share on other sites

Thanks. But do you mean adding this under 'Automatic Page Name Format'?

Or here:

protected function renderTableCol(Page $item, array $fields, $column, $width, $linkURL = '') {
    $out = $this->getItemValue($item, $fields, $column); 
    if($linkURL) $out = "<a class='InputfieldPageTableEdit' data-url='$linkURL' href='#'>" . $out->template.label . "</a>";
    $attr = $width ? " style='width: $width%'" : '';
    return "<td$attr>$out</td>";
}
Link to comment
Share on other sites

Haha yes! That is brilliant. I'm guessing you can't change the 'Template > Template.label' text to something more user friendly? That's definitely not the end of the world though. Really really appreciated.

Screen%20Shot%202015-03-06%20at%2015.58.

Link to comment
Share on other sites

  • 1 year later...

Hi all!

Bringing up this old thread...

I'm guessing you can't change the 'Template > Template.label' text to something more user friendly?

My hope was to solve this by modifying the entries in the textarea "Table fields to display in admin".

For, say,  a field "text" of fieldtype file with the Label "Notes"  I had the entry "text.filesizeStr", hence the column title was "NOTES > TEXT.FILESIZESTR".

Wanting the title "SIZE" instead, I tried the entry "Size=text.filesizeStr".

And really, the column title changed to "SIZE". But the column lost its values - all its cells were empty.

So I assume that it needs just a slightly different syntax for the entry to work... Suggestions welcome!

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 years later...

Hey!

When using this great module with the delegate template approach (setting a new subfolder in field settings "Path to template").
Iam still getting warnings inside the backend, that the file doesn't exist. Everything else works as expected. Any ideas how to fix this or disable the warning?

TemplateFile: Filename doesn't exist: /Users/janploch/sites/michael-bader/dist/site/templates/block_icon.php

Putting this inside every template file from my subfolder, works but I would like to avoid that:

$page->template->filename = $config->paths->templates . "blocks/" .$page->template->name. ".php";

 

Link to comment
Share on other sites

  • 1 month later...
On 11/8/2020 at 1:59 PM, jploch said:

When using this great module with the delegate template approach (setting a new subfolder in field settings "Path to template").
Iam still getting warnings inside the backend, that the file doesn't exist. Everything else works as expected. Any ideas how to fix this or disable the warning?

Coming back to this, I found out that this is just affecting my local dev environment with laravel valet.
On a live server this is not an issue. So never mind ?

 

 

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

×
×
  • Create New...