Add feed url attributes to content objects #2513
Open
+158
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi everyone!
After my first try (#2510) I found @avaris comment that I thought was a much better approach to this, but had a few questions I wanted to run past everyone.
The main idea from that thread was that we should try to avoid theme creators generating their own urls manually. Mainly to prevent things from breaking when changes are made in the future. Like Atom and RSS Feed settings :)
This fix will add
atom_feed_url
andrss_feed_url
attributes to theTag
,Category
, andAuthor
objects, as well as addlang_rss_feed_url
andlang_atom_feed_url
to theContent
object.I've also included updates to the 'simple' theme to use these attributes, that my first attempt fixed, but didn't address the real issue of building urls in the themes directly.
This does not update the documentation, or setup any tests to make sure this works properly mainly because I wasn't sure what to do about the
FEED_ATOM, FEED_RSS, FEED_ALL_ATOM, FEED_ALL_RSS
settings. To me it would be wierd to have:for all content, and
for each category and translation.
My plan was to get an idea of what everyone though before I finish the documentation and tests.
So here are my questions for some of the more veteran developers.
Why don't we treat translations like we do with Categories and Tags by having a Translation object? Would that make sense if we did?
What should we do about the
FEED_ATOM, FEED_URL
settings? Should they stay as they are and let theme developers use them directly? or should we have a Feeds object passed as another Common Variable to all the templates? (eg:feed.atom_all_url
)Going the common variable route would give us the ability to prevent using the settings that don't need formatting in the theme directly. So that's a plus
Sorry for the wall of text.
Hope everyone is having a great 2019!