Search

Hi,

I was trying to make and admin menu appear filtering the username on the value of {$cookie-username}. It was effectless. Thus I decided to have a look at the starting example that is in the install package and I discovered a :0 after the name of the param.

May be my question is trivial but I have the excuse of not being a developper. What does this mean and where can I read more to improve my understanding?

Regards

{$cookie-username:0} means that if symphony doesn't find a $cookie-username variable it will try look up a user with a string value of 0.

In other words, when a parameter is not found by default it will fetch all the entries. By defaulting to 0 if not found. 0 should match no usernames in your system, hence find no matches.

If you try to debug you will most likely find that omitting 0 will return all the users in your system if there is no user logged in (or the first one if you have a limit of 1)

Thank you gunglien for your answer.

I experimented what you say and could see you are right. Nevertheless I would like to know more. Is there a place where this syntax is explained that I missed or do you know this because, being a developper, you know the intimacy of the PHP code?

(or the first one if you have a limit of 1)

Yes, but how to fix the limit? I don't see any limit field in the datasource.

Hi jaaf,

Yes sure, you have a pagination section in the datasource. Here you can set the Entries per Page aka limit and Page Number shows which set you want. IF you want the first items this should be 1. IF you want the entries 21-40. Entries per page would be 20 and page number 2.

Note you can use a variable for both entries per page and page number so then you can use pagination in the frontend.

Thank you again gunglien,

Yes sure, you have a pagination section in the datasource

I already knew that. It is true for all my other datasources but this section doesn't appear in the datasource with author as source.

And what about my first question:

Is there a place where this syntax is explained that I missed or do you know this because, being a developper, you know the intimacy of the PHP code?

Regards.

already knew that. It is true for all my other datasources but this section doesn't appear in the datasource with author as source.

Ah my bad, I didn't really follow that part. Most likely if it's provided by an extension the limit would be within the query of the datasource so not editable.

Is there a place where this syntax is explained that I missed or do you know this because, being a developper, you know the intimacy of the PHP code?

I'm pretty sure it should be documented somewhere. There's a use case here which shows how you can fallback to a colour red.. It's fairly common use as fallback, however I don't think it's clearly written that you can use a 'not found' value for a datasource to return empty.

I'm pretty sure it should be documented somewhere. There's a use case here which shows how you can fallback to a colour red.. It's fairly common use as fallback, however I don't think it's clearly written that you can use a 'not found' value for a datasource to return empty.

That is not perfect but it is a starting base. Maybe I should experiment a bit more and, why not, have a look at datasource processing in the PHP code.

Theres a chart here

http://www.getsymphony.com/learn/concepts/view/data-source-filters/

Yes, thanks. It is the one gunglien is speaking about and that I didn't read carefully enough.

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