- Posts: 3
COMMUNITY FORUM
Second author for one blog entry
- yvonne
- Topic Author
- Offline
- New Member
Less
More
7 years 3 months ago #163221
by yvonne
Second author for one blog entry was created by yvonne
Hallo,
I have a blog with professional articles- but some of them are written by many authors, not only by one.
Can someone help me to add a secont author?
Or do someone hava a tip how I could show the secont author?
thanks for your help, yvonne
I have a blog with professional articles- but some of them are written by many authors, not only by one.
Can someone help me to add a secont author?
Or do someone hava a tip how I could show the secont author?
thanks for your help, yvonne
Please Log in or Create an account to join the conversation.
- Ronny Van Der Borght
- Offline
- Senior Member
7 years 3 months ago #163231
by Ronny Van Der Borght
Replied by Ronny Van Der Borght on topic Second author for one blog entry
You could add an extra field for this purpose.
For instance: A field for the authors name, one for his/her email etc...
If you need 'unlimited authors' you could check Joomreem's exellent Dataset plugin: www.joomreem.com/extensions-store/k2-datasets#.WYQmFIppxMM
You can use this to make datasets from your extra fields.
But this would need some template customisation.
For instance: A field for the authors name, one for his/her email etc...
If you need 'unlimited authors' you could check Joomreem's exellent Dataset plugin: www.joomreem.com/extensions-store/k2-datasets#.WYQmFIppxMM
You can use this to make datasets from your extra fields.
But this would need some template customisation.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 3 months ago #163241
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Second author for one blog entry
Ronny you rock :)
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- yvonne
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
7 years 3 months ago #163246
by yvonne
Replied by yvonne on topic Second author for one blog entry
Hallo, thank you for your idea.
I already tried to use the extra fields, but I want to use the 'author site' . when I choose the author I want to see a list of all articles and i use a filter where I need the author.
maybe someone knows which php-files I have to change to add a second author field in back- and fronted.
..and sorry for my english ;)
I already tried to use the extra fields, but I want to use the 'author site' . when I choose the author I want to see a list of all articles and i use a filter where I need the author.
maybe someone knows which php-files I have to change to add a second author field in back- and fronted.
..and sorry for my english ;)
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 3 months ago #163272
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Second author for one blog entry
Your English is perfectly fine.
Keep in mind that you can render a specific extrafield's value in your site.
So you can have both the link as an extrafield (text field or select element) and the name of the author in one HTML element in order to build your link.
A basic example can be found here:
github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L168-L173
The item's php file is the item.php file and always use overrides.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
Keep in mind that you can render a specific extrafield's value in your site.
So you can have both the link as an extrafield (text field or select element) and the name of the author in one HTML element in order to build your link.
A basic example can be found here:
github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L168-L173
The item's php file is the item.php file and always use overrides.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Ronny Van Der Borght
- Offline
- Senior Member
7 years 3 months ago - 7 years 3 months ago #163288
by Ronny Van Der Borght
Replied by Ronny Van Der Borght on topic Second author for one blog entry
I guess you could even use the K2 tags for this. I used it once like this:
1. Add the Authors as tags (John Doe, Peter Sellars, Peter Falk, etc...)
2. Add a new K2 category named 'Authors'
3. Add a K2 item for every author, use extra fields for the specifics
4. Attach the corresponding tag to the k2 item (The k2 item for 'John Doe' gets the tag 'John Doe')
5. Finally: Link all the other articles with the authors k2 tags
Now change your k2 templates. Work with the 'related items by tag' options.
Example for item.php (always work with overrides!!!):
change: <span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span> into <span>Authors:</span>
and
change <h3><?php echo JText::_("K2_RELATED_ITEMS_BY_TAG"); ?></h3> into <h3>Other articles by this author</h3>
You could even change tags.php.
Tip for advanced k2 users: If you don't want the k2 item for the authors itself (from the k2 category 'Authors') to show up in the list for the articles you could add an exeption to the foreach loop like this:
Change:
<?php foreach($this->relatedItems as $key=>$item): ?>
<!-- author block -->
<?php endforeach; ?>
Into:
<?php foreach($this->relatedItems as $key=>$item): ?>
<?php if($item->category->name !=="Authors"): ?>
<!-- author block -->
<?php endif ;?>
<?php endforeach; ?>
Using this concept you could have 2 related items blocks: one that pulls the author(s) info and one that pulls the articles.
1. Add the Authors as tags (John Doe, Peter Sellars, Peter Falk, etc...)
2. Add a new K2 category named 'Authors'
3. Add a K2 item for every author, use extra fields for the specifics
4. Attach the corresponding tag to the k2 item (The k2 item for 'John Doe' gets the tag 'John Doe')
5. Finally: Link all the other articles with the authors k2 tags
Now change your k2 templates. Work with the 'related items by tag' options.
Example for item.php (always work with overrides!!!):
change: <span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span> into <span>Authors:</span>
and
change <h3><?php echo JText::_("K2_RELATED_ITEMS_BY_TAG"); ?></h3> into <h3>Other articles by this author</h3>
You could even change tags.php.
Tip for advanced k2 users: If you don't want the k2 item for the authors itself (from the k2 category 'Authors') to show up in the list for the articles you could add an exeption to the foreach loop like this:
Change:
<?php foreach($this->relatedItems as $key=>$item): ?>
<!-- author block -->
<?php endforeach; ?>
Into:
<?php foreach($this->relatedItems as $key=>$item): ?>
<?php if($item->category->name !=="Authors"): ?>
<!-- author block -->
<?php endif ;?>
<?php endforeach; ?>
Using this concept you could have 2 related items blocks: one that pulls the author(s) info and one that pulls the articles.
Last edit: 7 years 3 months ago by Ronny Van Der Borght.
Please Log in or Create an account to join the conversation.
- yvonne
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
7 years 3 months ago #163293
by yvonne
Replied by yvonne on topic Second author for one blog entry
Thanks a lot for your help!
I will try to realise your ideas.
I will try to realise your ideas.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 3 months ago #163310
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Second author for one blog entry
Nice one :)
That's a clever solution.
That's a clever solution.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.