Search

I fixed the two bugs and added the possibility to filter the list of pages in the dropdown by page type (http://github.com/klaftertief/pagesfield).

Nice work. I’ve also got a fork of this that automatically hides any Pages that are given the ‘hidden’ type.

Perhaps we could expand your filtering capabilities so that you can filter on multiple page types? I suppose there needs to be some consideration that pages without types should either come in as default, or be selectable somehow as on larger sites I think it’d be annoying to have to give all your pages a type so that it can be filtered on.

Thoughts?

I saw your fork just before pushing my changes and I sent you a pull request. I’m using the Page Select Field mainly for static content and I’m in the process of writing (yet another) static content manager, hence the changes.

Filtering by multiple page types is already possible and I want to implement a negation logic. This way you can define a filter like -hidden (like Nils does it the Mediathek category filter) instead of a hardcoded filter.

I see the compatibility of this plugin unsure with Symphony 2.2, is this compatible?

I haven't tested yet and will do in a couple of minutes, but I'm still asking because I'm wondering how experienced symphony developper do link contents to pages without such a plugin? Do you keep your "static" content in your template?

I'm asking because I'm new to symphony and find it the best answer for dynamic content, but what about more static content.. how do you guys deal with it?

Thanks for the replies.

You can use my fork, which also has some additional features. I sent a pull request to its (probably) new home couple of days ago.

Thank you! It work perfectly! Cheers.

Is there a way for this extension to show the sub-pages in the publish page? For example, if I choose a page like Page/SubPage/AnotherSubPage in my publish index-page I only see AnotherSubPage. It would be better if I could see the full path, especially for sorting purposes.

I managed to get the extension to display the full path, but the sorting-function doesn't quite work (since it goes alphabetically instead of looking at the pages-table with it's parents and sortorder-column.

@kanduvisla: I hopefully have something working at the weekend.

@klaftertief

I'm using your extension on a site and have a small issue. I'm not sure it is part of your extension actually or part of Symphony.

So I created a data source that fetchs all the content for one given page from my "content" section.

This page hase a single quote ' character it is name. Now my data source is filtering the content by page name, for instance: "L'imprimerie"

In my xml I have a SQL error because of the quote. Can you tell my if this is part of your extension or is something with symphony..?

<contenu-imprimerie>
    <error>MySQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'imprimerie') OR `t41`.handle IN ('L'imprimerie') OR `t41`.title IN ('L'imprimeri' at line 9 in query "SELECT SQL_CACHE `e`.id,
                    `e`.section_id, e.`author_id`,
                    UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`
            FROM `sym_entries` AS `e`
             LEFT JOIN `sym_entries_data_41` AS `t41` ON (`e`.`id` = `t41`.entry_id) 
            WHERE 1

            AND `e`.`section_id` = '12' 
             AND (`t41`.page_id IN ('L'imprimerie') OR `t41`.handle IN ('L'imprimerie') OR `t41`.title IN ('L'imprimerie')) 
            ORDER BY `e`.`id`DESC"</error>
</contenu-imprimerie>

I just tryed filtering with a parameter {$page-title} and I have the same problem.

Thats definitely a bug (either in the extension or Symphony). But you can and should filter by id ($current-page-id) to guarantee to get the page content you want (in the case of pages with the same name). And this should eliminate your SQL error as well.

You are right.. that is the way to go, I should have thought about it! I still have a lot to learn on Symphony! :)

Thanks a lot.

@klaftertief thanks for your (continued) work on this. I run into a strange thing (might be related to previously mentioned issues):

I have a DS 'Page Content' that filters entries from a Page Content Section, based on {$current-page}. This DS outputs the param page (Pages Field) as $ds-page-content.

In another DS ('subpages') I query Parent in 'Navigation', based on the abovementioned {$ds-page-content}. This should result in a list of sub-Pages of the current page. However, I get <error>No records found.</error>.

When I replace {$ds-page-content} in my Subpages DS with a harcoded '/about-us' slug it works (I get all sub-Pages of 'About us') ...

To me this indicates that the Pages Field value (outputted from my other DS) returns something else than a slug. This is not properly picked up by my Subpages (Navigation) DS.

Is this a bug? I could potentially edit my DS by hand but it seems unnecessary.

public $dsParamFILTERS = array(
    'parent' => '{$ds-page-content}',
);

My guess is that parent in the $dsParamFILTERS needs an ID or Slug and {$ds-page-content} returns a Title?

Note: I should note that the Subpage DS works fine with {$current-page}. The issue is not that I can't get the subpages through this DS, it's that I believe the DS output param {$ds-page-content}, based on a Pages Field is outputting the wrong type ('Title' instead of handle)

To me this indicates that the Pages Field value (outputted from my other DS) returns something else than a slug. This is not properly picked up by my Subpages (Navigation) DS.

Yep, it uses the standard field class implementation of the getParameterPoolValue() method which returns the value of the field in the entry list table. So something in the form Root / Parent / Child.

My guess is that parent in the $dsParamFILTERS needs an ID or Slug and {$ds-page-content} returns a Title?

Yep, the parent-filter in navigation DSs needs a path.

So. What are the options? You could use {$current-path} as the DS filter, but this also contains page parameters and URL parameters. Or you could use {$parent-path}/{$current-page} to just get the path to your current page. Or somebody could add a getParameterPoolValue()-method for the Page Select Field that outputs the path, usable for navigation DS filtering. It's not hard to implement, maybe I find the time at the weekend. Or should it return the page id, or just the handle?

And on last note.

I have a DS 'Page Content' that filters entries from a Page Content Section, based on {$current-page}

You should filter by ID, in case of pages with the same title.

Hi klaftertief, I believe I have found a bug with pagesfield.

The short of it is that it seems an entry with an empty pagesfield (no page selected) and the Display field’s value in entries table option is checked results in a fatal SQL error (trying to fetch pages WHERE p.'id' = [BLANK]).

Unchecking Display field’s value in entries table for this pagesfield solves the issue but I believe it should be possible to display pagesfield Value (of 'None') in the Publish Listing when a pagesfield is not required, correct?

Hey David, thanks for reporting. The bug is fixed.

For some reason, I had the gitHub Repo as git://github.com/symphonycms/pagesfield.git. I seem to believe that this was working for me; however, when I went to instantiate a new site today that repo gives me a 404.

What is the official repo for the pagesfield extension?

just submitted a pull request - for a minor bug in the back-end relating to the table view when multiple pages can be selected. Works on 2.2.5 - should work on older releases as well.

Can anyone test this and confirm? I'll pull it in if so, no Sym installs at present :(

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details