Morrigan Posted April 28, 2016 Posted April 28, 2016 So this is something newish and I know that there is the twitter integration so this could be an awesome addition. This may not work "with" the integration but it would be a good SEO thing to allow for people to set it up. https://dev.twitter.com/cards/overview Just a thought. Starship, chilihead, The Old Man and 2 others 5
opentype Posted April 28, 2016 Posted April 28, 2016 I recommended it too a while ago. Makes perfect sense to support these Twitter meta tags along with the ones Facebook looks for. Tweets with images are so much more likely to get clicks than just plain links. If you can’t wait: it’s surprisingly simple to add it to certain templates. For example, I added this to my video database in Pages: {{\IPS\Output::i()->metaTags['twitter:card'] = 'summary_large_image';}} {{\IPS\Output::i()->metaTags['twitter:site'] = '@TypographyGuru';}} {{\IPS\Output::i()->metaTags['twitter:title'] = $record->_title;}} {{\IPS\Output::i()->metaTags['twitter:description'] = 'Watch this video in the collection of the best typography videos on Typography.Guru';}} {{\IPS\Output::i()->metaTags['twitter:image'] = (string) \IPS\File::get( 'cms_Records', $record->record_image )->url;}} The Old Man, Starship, Morrigan and 6 others 8 1
Morrigan Posted April 28, 2016 Author Posted April 28, 2016 Oh yeah. I was looking into adding it myself as well but integration for people that aren't as savvy would be good. The Old Man, Joey_M and chilihead 3
BenCurry Posted August 31, 2016 Posted August 31, 2016 Hi, I have been searching this site for something similar and this post came up. Does anyone know if this went anywhere? Currently when a link to the sate gets tweeted the image shared is the one of my site logo. I would like this to first check the thread/blog/article that is being shared and if no image if found then use the site logo. Is this possible? Thanks ايمن 1
steadyoptions Posted September 8, 2016 Posted September 8, 2016 (edited) It is my understanding that IPS currently doesn't support it. Question: if I want to implement it on article pages, which template should I put it to? Also, why the code above different from the sample code supplied by Twitter here? Edited September 8, 2016 by steadyoptions
Strakks Posted December 15, 2016 Posted December 15, 2016 On 2016-09-08 at 9:52 PM, steadyoptions said: It is my understanding that IPS currently doesn't support it. Question: if I want to implement it on article pages, which template should I put it to? Also, why the code above different from the sample code supplied by Twitter here? ¨Same! Where to implent it?
opentype Posted December 15, 2016 Posted December 15, 2016 On 9/8/2016 at 9:52 PM, steadyoptions said: Question: if I want to implement it on article pages, which template should I put it to? In the Pages template your database uses for the “record view”. On 9/8/2016 at 9:52 PM, steadyoptions said: Also, why the code above different from the sample code supplied by Twitter here? It isn’t. It’s an application of the Twitter code. You can’t just paste the Twitter code. It’s just an example. The fields need to be populated with the dynamic content from the database record. Also, don’t just copy my code above. That’s also just an example. My Pages template include Twitter card support. You don’t need to do anything else than add your Twitter handle to the template. sobrenome 1
sobrenome Posted March 19, 2017 Posted March 19, 2017 On 28/04/2016 at 3:44 PM, opentype said: I recommended it too a while ago. Makes perfect sense to support these Twitter meta tags along with the ones Facebook looks for. Tweets with images are so much more likely to get clicks than just plain links. If you can’t wait: it’s surprisingly simple to add it to certain templates. For example, I added this to my video database in Pages: {{\IPS\Output::i()->metaTags['twitter:card'] = 'summary_large_image';}} {{\IPS\Output::i()->metaTags['twitter:site'] = '@TypographyGuru';}} {{\IPS\Output::i()->metaTags['twitter:title'] = $record->_title;}} {{\IPS\Output::i()->metaTags['twitter:description'] = 'Watch this video in the collection of the best typography videos on Typography.Guru';}} {{\IPS\Output::i()->metaTags['twitter:image'] = (string) \IPS\File::get( 'cms_Records', $record->record_image )->url;}} Perfect!
sobrenome Posted March 30, 2017 Posted March 30, 2017 On 28/04/2016 at 3:44 PM, opentype said: {{\IPS\Output::i()->metaTags['twitter:image'] = (string) \IPS\File::get( 'cms_Records', $record->record_image )->url;}} Is there a way to mix text and strings? I want to output record's description mixing a common description text and with strings: record title and database category name. And is there an easy way to use tags as keywords?
sobrenome Posted March 30, 2017 Posted March 30, 2017 It's working for me: {{\IPS\Output::i()->metaTags['description'] = 'Text ' . $record->_title . ', text ' . $record->container()->_title . ', text ' . $record->author()->name . '.';}} What about the tags as keywords?
sobrenome Posted March 30, 2017 Posted March 30, 2017 This code is not fine because results in multiple metatags for keywords: {{\IPS\Output::i()->metaTags['keywords'] = $record->tags();}} Result in:
sobrenome Posted March 31, 2017 Posted March 31, 2017 @opentype, is there a way to use tags as meta keywords?
opentype Posted March 31, 2017 Posted March 31, 2017 {{\IPS\Output::i()->metaTags['keywords'] = implode(',',$record->tags());}} sobrenome, Joel R and Meddysong 2 1
Strakks Posted May 15, 2017 Posted May 15, 2017 On 2016-12-15 at 7:56 PM, opentype said: In the Pages template your database uses for the “record view”. It isn’t. It’s an application of the Twitter code. You can’t just paste the Twitter code. It’s just an example. The fields need to be populated with the dynamic content from the database record. Also, don’t just copy my code above. That’s also just an example. My Pages template include Twitter card support. You don’t need to do anything else than add your Twitter handle to the template. Does your Supergrid view forumposts the same as grid?
opentype Posted May 15, 2017 Posted May 15, 2017 2 hours ago, Strakks said: Does your Supergrid view forumposts the same as grid? Sorry, I don’t understand the question.
Strakks Posted May 15, 2017 Posted May 15, 2017 4 hours ago, opentype said: Sorry, I don’t understand the question. Is forum posts viewed like grid? instead of plain text
Joel R Posted May 15, 2017 Posted May 15, 2017 2 hours ago, Strakks said: Is forum posts viewed like grid? instead of plain text To clarify, the Supergrid template by @opentype only applies to records / articles created in IP.Pages. It does not change the layout of IP.Board posts or topics.
Strakks Posted May 16, 2017 Posted May 16, 2017 7 hours ago, Joel R said: To clarify, the Supergrid template by @opentype only applies to records / articles created in IP.Pages. It does not change the layout of IP.Board posts or topics. Okay thanks. That's what I needed to know. Is there anything that works the same as grid but applies to forums?
Simon Woods Posted May 16, 2017 Posted May 16, 2017 9 hours ago, Strakks said: Is there anything that works the same as grid but applies to forums? For forum listings, yes. For post listings, no. Which one are you looking for?
Strakks Posted May 16, 2017 Posted May 16, 2017 4 hours ago, Simon Woods said: For forum listings, yes. For post listings, no. Which one are you looking for? This https://gyazo.com/7a08befb0e4da9bb418d718828eb04a6 The topic title. Is that possible?
Morrigan Posted May 16, 2017 Author Posted May 16, 2017 @Strakks you should ask in the Peer assistance forum for help to design this yourself or else hire someone to make that for you. Either via a mod or theme design.
Strakks Posted May 16, 2017 Posted May 16, 2017 Just now, Morrigan said: @Strakks you should ask in the Peer assistance forum for help to design this yourself or else hire someone to make that for you. Either via a mod or theme design. So the grid wont apply to topic title?
Morrigan Posted May 16, 2017 Author Posted May 16, 2017 The grid style only applies to forum lists. The mod above will do it for databases in pages. Neither of which will touch topics.
Recommended Posts