May 4, 2011

Template Shortcodes for feed/channel tags | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
Template Shortcodes for feed/channel tags
Topic Rating: 5 Topic Rating: 5 Topic Rating: 5 Topic Rating: 5 Topic Rating: 5 Topic Rating: 5 (1 votes) 
December 17, 2022
4:51 pm
Avatar
MediFormatica
Member
Members
Forum Posts: 49
Member Since:
December 17, 2022
sp_UserOfflineSmall Offline

Just starting to use CyberSEO, and so far I like it.

I've been using WPeMatico and want to convert my templates to CyberSEO. The post "items" tags defined here (Login to see this link) are mostly covered but I can't access the feed information.

Login to see the code

For example WPeMatico has the following tags

{feedurl}, {feedtitle}, {feeddescription}, {feedlogo}, {feedfavicon}

I've tried the following but it didn't work

%xml_tags[channel:title]%
%xml_tags[channel:description]%
%xml_tags[channel:link]%

December 17, 2022
5:39 pm
Avatar
CyberSEO
Admin
Forum Posts: 3947
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Please refer to the manual: Login to see this link

The corresponding template shortcodes will look like this:

Login to see the code

E.g., wherever you put the %post_title% shortcode, it will be replaced by the actual post title.

Yet another example. If you want to have a link to source article below your post, your Post template should look like this:

Login to see the code

if you want to have a corresponding YouTube video above that post, use the following template:

Login to see the code

and so on...

December 17, 2022
6:54 pm
Avatar
MediFormatica
Member
Members
Forum Posts: 49
Member Since:
December 17, 2022
sp_UserOfflineSmall Offline

Thanks for the response.

I understand the that the %post_xxxx% shortcodes will pull the details relevant to the item being imported, but at the top of the rss feed there is some information about the feed itself and that's what I'm looking for. Those tags appear before the first tag.

For example, if you look at Login to see this link

Feed Information - This is what I'm trying to get

Login to see the code

Item Information - This is what the %post_xxxx% shortcodes are giving me.

Login to see the code

December 17, 2022
7:13 pm
Avatar
CyberSEO
Admin
Forum Posts: 3947
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Which exactly parts of this information you are interested in? I can implement these shortcodes or do it somehow else. Actually it's a first time for 16 years when someone asking about this. To be honest, I just don't understand how it can be used in a real project...

December 17, 2022
7:52 pm
Avatar
MediFormatica
Member
Members
Forum Posts: 49
Member Since:
December 17, 2022
sp_UserOfflineSmall Offline

smile To be very honest, I only thought about using those tags when I saw them implemented in WPeMatico.

Basically, I would like to give credit to the original author of the articles I'm collecting from the different feeds. The extra feed information allows me to do that, but it isn't essential.

Here's an example from my website using WPeMatico. I would like to move to CyberSEO instead.

Login to see this link

Here's the template I've created with WPeMatico

Login to see the code

{permalink} - Post item URL

{campaigntitle} - this is the name I've given to the feed configuration, this just allows me to use the same template across all feeds without having to enter the name manually in each feed template.

{author} - post item author

{content} - post item content

{title} - post item title

{feedfavicon} - feed favicon URL, I guess they're getting it from the feed's website

{feedlogo} - a URL to an image but I'm not really sure where exactly they get it from.

{feedtitle} - name of the feed

{feeddescription} - description of the feed

I've been able to recreate it partially in CyberSEO. Still need to figure out the Author (probably using %xml_tags[name]%), and the rest is just the feed info

Login to see the code

December 17, 2022
9:18 pm
Avatar
CyberSEO
Admin
Forum Posts: 3947
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

That's correct. If the author tag is defined somewhere inside your feed's <item> section, you can extract it as %xml_tags[author]%. But course it must be defined in the feed.

For example, WordPress-generated feeds have no author tag at all: Login to see this link - the author's name of all posts and pages there is "admin", but the feed doesn't show it.

Here you can see all the standard tags that any RSS or Atom feed may have: Login to see this link

Usually you need to read only the tags inside the <item> (RSS) or <entry> (Atom) sections.

December 18, 2022
11:40 am
Avatar
CyberSEO
Admin
Forum Posts: 3947
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Since CyberSEO Pro is a professional tool, you can use your PHP coding skills to do any tricks and extract any content from anywhere.

Here is an example for you. You said you pull this feed: Login to see this link

As you can see, there is no <author> tag in it. But, there is link to the original article, which has it. E.g. Login to see this link

If you open the page source, you'll see that the author's name is stored as "author":"Emily Olsen ". So in order to extract it, you can use this simple PHP code:

Login to see the code

Just put in into the Custom PHP code box in your feed settings and the author's name will appear below every syndicated post.

Here are the links that will help you to understand and modify the code above for other similar cases:

Login to see this link

Login to see this link

December 19, 2022
12:13 am
Avatar
MediFormatica
Member
Members
Forum Posts: 49
Member Since:
December 17, 2022
sp_UserOfflineSmall Offline

Thank you.

Using Custom PHP does give limitless possibilities. I've already broken my site twice with some bad PHP code. I'll need to investigate this further with a clear mind. Right now I'm focused on moving the feeds over to CyberSEO.

For the author field I'm using %xml_tags[dc:creator]% which seems to be supported by the majority of feeds.

Also found that google can give me the favicon without relying on the feed.

Login to see the quote

I'm then manually adding the feed title and description.

This covers my needs for the time being and CyberSEO has already given me more features out of the box, until I have the time to try out the custom PHP feature.

December 19, 2022
12:32 am
Avatar
CyberSEO
Admin
Forum Posts: 3947
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

You can use my code snippets with no fear. They are safe and won't break your site.

Yes, the <dc:creator> is a way to go, but WordPress dosn't generate it out of the box.

December 19, 2022
1:22 am
Avatar
MediFormatica
Member
Members
Forum Posts: 49
Member Since:
December 17, 2022
sp_UserOfflineSmall Offline
10sp_Permalink sp_Print
0

OK, that sounds great. I'll do that once I'm done moving the feeds.

BTW, is this making another call to the website to get the contents for resolving the author?

I'm already extracting the full text article, so worried that this would be adding an overhead, in which case I would need to weigh the benefits in terms of performance.

But, hey, I really appreciate you taking the time to write the script. It will also help me explore the Custom PHP functionality.

December 19, 2022
1:28 am
Avatar
CyberSEO
Admin
Forum Posts: 3947
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline
11sp_Permalink sp_Print
0

Of course it will load the page twice. So it will take a little bit more time to process the feed, but it won't load your CPU. According to your other thread I assume you have some tight limitation on server resources. Is that correct?

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
5 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 68

Freedom: 61

Pandermos: 54

MediFormatica: 49

B8europe: 48

Member Stats:

Guest Posters: 337

Members: 2853

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1640

Posts: 8352

Newest Members:

wanmarkets, torontomark48, info.ckmedianetwork, contact.mybeautystar, samuelbodde, john.prush

Administrators: CyberSEO: 3947