0 users online. Create an account or sign in to join them.Users

Search

Hello everyone,

It seems author fields can not be outputted to a parameter.

I'm wondering why and if it is a normal behavior.

Thanks for your reply.

It was available when I just checked. Have a screenshot of what you see?

It may depend on the version of Symphony you are using. A while ago, I recall creating an (unpublished) extension to overcome the limitation. I think the issue has since been addressed.

Edit: perhaps this is completely unrelated: Author Login extension.

I'm using 2.2.5. I'm talking about the Author field, not the System Author.

I double checked and created a new section and datasource. Still not possible. May be there is a reason for this.

Thanks for your help.

Pretty sure Author = System Author.

I just checked it is outputting the real System Author.

So I can't see any reason why I could not output the Author field. Is it a bug may be?

I have added this inside toolkit/fields/field.author.php

public function allowDatasourceParamOutput(){
    return true;
}

So I get the param to be outputted:

 <ds-current-author>
    <item handle="john-doe">John Doe</item>
 </ds-current-author>

But I would need the ID instead of the Full Name, like the System Author so I can use it inside a filter. I thought I would be able to tweak it myself by changing the appendFormattedElement function, but it actually changes the XML for the datasource.

Anyone know which function is used for the parameter output?

Anyone know which function is used for the parameter output?

Field::getParameterPoolValue is called. The default Field implementation is to fall back to the prepareTableValue method.

Thanks a lot Nick! I got it working.

Do you know if it is a normal behavior for the Author field to not allow parameter output? Should I report this as an issue?

The Author field is probably the least used of all the core fields, so I reckon this is just an oversight. By all means open an issue on the tracker with the code changes, or if you're competent with git, send a patch via a pull request. But code in an issue is better than nothing :-)

I just checked it is outputting the real System Author.

Dangit, I see it now! I'm on the slow boat this week :)

I just sent my first pull request :-)

I forked and worked on the master branch. Not sure if this is the way to go.

For something as simple as this, I don't think it's a big problem ;o)

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