joomla-projects / custom-fields

[READ-ONLY] This repo is no longer in active development. Please see https://github.com/joomla/joomla-cms | Repository for custom fields integration, instructions can be found below!
https://joomla.digital-peak.com/blog/198-custom-fields-in-joomla-3-7
GNU General Public License v2.0
22 stars 8 forks source link

Improve Article Field #128

Open coolcat-creations opened 8 years ago

coolcat-creations commented 8 years ago

The Article Field is a selection from Articles. It would be good to have the possibility to select a Parent Category for this selection, and to define how the output should be. For now it´s just the title as a plain text. I think it´s more useful as article link?

laoneo commented 8 years ago

The article form field doesn't support categories. There is a category form field, but it also prints only the name of it. If you want to change the layout of the article field, then feel free to make a PR with a change of this file https://github.com/joomla-projects/custom-fields/blob/custom-fields/components/com_fields/layouts/field/prepare/modal_article.php.

coolcat-creations commented 8 years ago

I can´t as i´m not a dev :-)

laoneo commented 8 years ago

Do you want to know how? Joomla would benefit if more people can do layout pull requests :metal: . It's very easy.

coolcat-creations commented 8 years ago

of course i want! :)

laoneo commented 8 years ago
  1. Clone the project
  2. Edit the file as described here https://help.github.com/articles/editing-files-in-your-repository, in our case https://github.com/joomla-projects/custom-fields/blob/custom-fields/components/com_content/layouts/field/prepare/modal_article.php.
  3. When you save, it offers you to create a PR.
  4. Create the PR.

Don't worry, if something goes wrong, it is always possible to fix it. Let me know if it works.

laoneo commented 8 years ago

Did it work?

coolcat-creations commented 8 years ago

Still on my to do list :-D But i will try it !!!

coolcat-creations commented 8 years ago

Ok i had a look but thousand ???? over my head. :-D How can i retrieve the link of the article? ok maybe by just echo "/index.php?option=com_content&view=article&Itemid=xy" but i really do just basic if else stuff thats all i´m able to (at least for now)

laoneo commented 8 years ago

Use something like ContentHelperRoute::getArticleRoute($article->id, $article->catid);. This should generate a link. Glad you are trying it!!

laoneo commented 8 years ago

I'm marking this one as a feature for later. Some more interesting options can be added on the article field, like showing the description, images, etc.