|
JDWordpress
v.2014-02-11
Wordpress Plugin for CakePHP
|
This class implements all actions for JDWordpress. More...
Public Member Functions | |
| beforeRender () | |
| Pass some common view variables to whatever view is going to be called. | |
Methods that display entire pages. | |
| index () | |
| Displays the newest blog post. More... | |
| archives () | |
| Displays the archives index page. | |
| categories () | |
| Displays the categories index page. | |
| tags () | |
| Displays the tags index page. | |
| view () | |
| Displays a single post if it exists, then tries to show summaries by Author-, Category-, or Tag-slugs respectively, and finally x number of posts if the parameter is numeric. More... | |
| rss () | |
| Returns an RSS feed (instead of an article) if called. More... | |
Methods for convenience. | |
| dump_wp () | |
| Zips the server's wordpress uploads directory and then sends it to the web browser for download. More... | |
| dump_sql () | |
| Dumps the MySQL database that this controller's model is attached to and then serve the file as a download,. More... | |
Methods intended to be used via `requestAction`. | |
SUPPORTING PIECES These are actions that should only ever be used with requestAction. HOWEVER, if an exception is pending requestAction can trigger rending of the exception's page immediately, so that's another good reason to avoid requestAction. Try using the helper instead. | |
| getOneRandomPost () | |
| Gets one random post. | |
| getSitemapBody () | |
| Returns the sitemap body (only) so that other controllers might compile the results into a full sitemap. | |
| tocArticlesWithDateHeaders () | |
| Will return a toc of all articles (optionally for $slug only) divided into year and month. | |
| tocForTaxonomyType () | |
Provides a list of all taxonomy types in a \<ul> toc format; for example can provide a list of each 'category'. | |
| tocRSSForTaxonomyType () | |
Provides a list of all taxonomy types in a \<ul> toc format with links to RSS feeds; for example can provide a list of each 'category'. | |
| tocRecent () | |
Returns the most recent 5 post titles in \<ul> format. More... | |
| tocTaxonomyArticles () | |
Provides a list of all terms for a specified taxonomy and its article titles in a \<ul> toc format; for example can provide a list of all 'category' and articles for each 'category. More... | |
Data Fields | |
| $components = array( 'JDWordpress.Zip', 'JDWordpress.JDBlogPostData' ) | |
| Components to use. | |
| $helpers = array( 'Rss' => array( 'className' => 'JDWordpress.FixedRss' ) ) | |
| Helpers to use. | |
| $layout = 'default' | |
| You probably don’t want to use the default CakePHP layout. | |
This class implements all actions for JDWordpress.
| index | ( | ) |
Displays the newest blog post.
This is really a rather boring index. You'd probably like to route to your own index and do something interesting there.
| view | ( | ) |
Displays a single post if it exists, then tries to show summaries by Author-, Category-, or Tag-slugs respectively, and finally x number of posts if the parameter is numeric.
This gives an interesting user experience whereby nearly any taxonomy, article name, author name, etc. will magically work.
| rss | ( | ) |
Returns an RSS feed (instead of an article) if called.
We'll do the same as for view and magically deliver a feed using a taxonomy if it exists:
If there's no trailing path, then deliver whole-site RSS limited to the past 30 days. Otherwise respectively deliver RSS results by treating the trailing path as Author, Category, then Tag.
| dump_wp | ( | ) |
Zips the server's wordpress uploads directory and then sends it to the web browser for download.
This is just a simple means of getting your remote WP data for local development.
If using the simple built-in security mechanism then this action requires a parameter, e.g., http://www.mysite.net/blog/dump_wp/secretpassword
| dump_sql | ( | ) |
Dumps the MySQL database that this controller's model is attached to and then serve the file as a download,.
This is just a simple means of getting your remote WP data for local development.
If using the simple built-in security mechanism then this action requires a parameter, e.g., http://www.mysite.net/blog/dump_sql/secretpassword
| tocRecent | ( | ) |
Returns the most recent 5 post titles in \<ul> format.
If an optional |slug| is given then the most recent five posts from the slug will be returned, on order of preference for author, category, and post_tag.
| tocTaxonomyArticles | ( | ) |
Provides a list of all terms for a specified taxonomy and its article titles in a \<ul> toc format; for example can provide a list of all 'category' and articles for each 'category.
'