Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Allows autodiscovery of BloggerAPI via RSD. Basically, we first insert a
<link ref="EditURI" type="application/rsd+xml" title="RSD" href="blogapi/rsd" />
into the header of the mainpage (requires http://drupal.org/node/view/8285)
and then we return an RSD XML to provide a preferred blog engine (default 'Blogger').
Note: CVS Drupal can probably handle Blogger APIs with maybe a few MetaWeblog APIs. It will fail on most MoveableType API.
Comment | File | Size | Author |
---|---|---|---|
#11 | drupal-head.junyor.blogapiv2.patch | 2.61 KB | Junyor |
#4 | drupal-head.junyor.blogapi.patch | 3.3 KB | Junyor |
#2 | blogapi.rsd_0.diff | 2.3 KB | jseng |
blogapi.rsd.diff | 2.08 KB | jseng | |
Comments
Comment #1
Dries CreditAttribution: Dries commentedI have a number of concerns with this patch:
Comment #2
jseng CreditAttribution: jseng commented1. fix space after commas
2. Add explaination of RSD and the usage.
3. Change engine name to 'Drupal'
ps: Sorry, I dont intend to change " to ' as that involves testing the patch all over. If thats the reason to reject the patch, so be it.
Comment #3
Dries CreditAttribution: Dries commentedThe patch won't work with HEAD. It still uses the old menu system.
Comment #4
Junyor CreditAttribution: Junyor commentedUpdated patch against HEAD.
Comment #5
Dries CreditAttribution: Dries commentedExcellent. I think we are almost there. There is one thing I'd like to discuss which is the introduction of a new hook called 'default_node'. Is this really necessary or can we use the nodeapi for this?
.
Comment #6
jseng CreditAttribution: jseng commentedfirstly, it is not strictly a 'node' thing. It is more of a page, ie, when you display the front page, you show this.
secondly, there arent any $op in hook_nodeapi() that triggers when you display the front page. of cos, we can add that.
Comment #7
Dries CreditAttribution: Dries commentedDoes it really makes sense to emit this link when looking at say, user profiles, forum posts or the news aggregator? I was mistakenly assumig that the 'EditURI' link should only be available when the content you are looking at is editable through a blogging application (i.e. when _nodeapi('view') gets called).
If so, instead of introducing a new hook, I suggest we abuse the _menu() or _link() hook like the atom module does. We could also use the _init() hook, but that will introduce more overhead.
I'll make these changes and integrate the code in HEAD as soon this get sorted (hopefully by tonight).
Comment #8
jseng CreditAttribution: jseng commentedyes, we shouldnt emit this
autodiscovery header unless it is the frontpage (and only the frontpage). Which is why we need the hook_default_node() invoked from node_page_default() only. And I am not sure you can do that with hook_menu() or hook_link() because you will emit this on every page if so.
No, it should not be emitted on any page that is editable, only the frontpage.
Perhaps it would be clearer if you understand how this autodiscovery stuff work.
Lets say you use a blogging tool (e.g. ecto on Mac or Zempt on Windows), then you want to blog to drupal.org so you create an account. You enter your blog website (http://drupal.org/), your userid and password. The blogging tool will do a http query to http://drupal.org/, retrieve the frontpage and look for
which will point them to your RSD (Really-Simple-Discovery) 'file'. (It is technically not a file in drupal). Then it do another query to retrieve your RSD 'file', which is basically an XML file containing information like where is the xmlrpc.php engine and the blogAPIs you support. (CVS drupal can only handle Blogger...can't do MovableType or MetaWeblog) so it can configure itself.
Complicated? Well, everything happens behind the scene for the blogger so it is pretty simple for him. All he realise is he entered his blogsite, his userid and password and bingo, the blogging tool knows how to interact with his blog, retrieve his past entries and can post new one.
Comment #9
jseng CreditAttribution: jseng commentedincidently, the way atom.module inserting its header to every page is also a problem :- e.g. in taxonomy/or/x page, you suppose to output the relevant atom headers, not for the whole site. as far as i know, there arent any hook there also.
if you dont like the hook_default_page(), then consider a hook_page($op) which $op could be = 'default' or different taxonomy page so other modules can drupal_set_html_head() for different kind of page.
Comment #10
moshe weitzman CreditAttribution: moshe weitzman commentedyou don't need a new hook to restrict injecting HTML to only the front page
if ($_GET['q'] == variable_get('site_frontpage', 'node')) {
// do something
}
Comment #11
Junyor CreditAttribution: Junyor commentedRighto. I've updated the patch using Dries' and weitzman's suggestions.
Comment #12
Dries CreditAttribution: Dries commentedCommitted to HEAD. Marking this fixed.
Comment #13
(not verified) CreditAttribution: commented