May 4, 2011

assigning a custom field to a XML tag attribute | 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
assigning a custom field to a XML tag attribute
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
September 27, 2013
1:27 pm
Avatar
mchughbri
Guest
Guests

How can i assign a custom field to a XML tag attribute? 

<event id=”123456789“>

</event>

September 27, 2013
1:34 pm
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Simple add the following parameter to your feed’s URL: custom_tags=custom_field_name1[,custom_field_name1,…]

For example, if your WordPress posts have views and thumb custom fields, you can display them as tags in the RSS feed using this URL: http://www.yourblog.com/feed/?custom_tags=views,thumb

September 27, 2013
1:51 pm
Avatar
mchughbri
Guest
Guests

I might not have been clear, sorry. I’m pullling in a 3rd party feed and it’s in that format. I want to set the ‘guid’ of the new post to the <event id=”1234567″> attribute. I can’t use event:id->guid – it doesn’t seem to work.

What would I need to add to the ‘Custom Fileds’ area in the feed settings?

September 27, 2013
2:24 pm
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

In “Custom fields”:

event->event

In “PHP code <?php .. ?>”:

Login to see the code

September 27, 2013
2:41 pm
Avatar
mchughbri
Guest
Guests

THanks. That’s great.

September 30, 2013
9:09 am
Avatar
mchughbri
Guest
Guests

No joy with this. should the ‘guid’ appear in the custom fields area after the post has been inserted? As it’s not showing there.

September 30, 2013
9:20 am
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Post GUID is not a custom field. It’s an attribute of the post which identifies its uniqueness. If you want a custom field called ‘guid’, you should do it like this:

Login to see the code

The only question is why?

September 30, 2013
9:50 am
Avatar
mchughbri
Guest
Guests

Yes, on reflection, maybe it doesn’t need to be ‘GUID’ therefore I’ve changed it to be a custom field as I would like to know the ‘event_id’

Custom fields : event->event

PHP : $post[‘custom_fields’][‘event_id’] = $post[‘custom_fields_attr’][‘event’][‘id’];

I’ve added ‘EVENT’ to the recognised tags also. The custom field event_id is there now but it’s still giving me a blank value. 

September 30, 2013
9:57 am
Avatar
CyberSEO
Admin
Forum Posts: 3689
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

I have to see URL of the actual RSS feed to tell you what’s wrong there.

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: 64

Freedom: 61

MediFormatica: 49

B8europe: 47

saviulisse67: 45

Member Stats:

Guest Posters: 338

Members: 2655

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1541

Posts: 7781

Newest Members:

kellyslrm, pu.analytics.ee, frajaros, federico_pac, rexfordkent, nick.jtsevents

Administrators: CyberSEO: 3689