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.
Problem/Motivation
Need to document render elements including code examples for the following elements:
- HtmlTag
- InlineTemplate
- Label
- Link
- MoreLink
- Pager
- StatusMessages
- SystemCompactLink
There may be other elements, but these seem straightforward candidates for documentation.
Proposed resolution
Document attributes and generate a code example.
Remaining tasks
Make a patch.
User interface changes
No. API docs only.
API changes
No. API docs only.
Data model changes
No. API docs only.
Comment | File | Size | Author |
---|---|---|---|
#24 | interdiff-2599454-19-24.txt | 1.19 KB | rakesh.gectcr |
#24 | 2599454-24.patch | 6.62 KB | rakesh.gectcr |
#22 | interdiff-2599454-19-22.txt | 1.19 KB | rakesh.gectcr |
#22 | 2599454-22.patch | 6.61 KB | rakesh.gectcr |
#19 | interdiff-2599454-16-19.txt | 1.53 KB | rakesh.gectcr |
Comments
Comment #2
metzlerd CreditAttribution: metzlerd commentedComment #3
metzlerd CreditAttribution: metzlerd commentedComment #4
jhodgdonAdding:
SystemCompactLink
Comment #5
metzlerd CreditAttribution: metzlerd commentedI've started this... but it will take me a bit to find the time to finish.
Comment #6
metzlerd CreditAttribution: metzlerd commentedComment #7
jhodgdonLooks pretty good!
A few suggestions:
We could make this more concise with the types as something like this:
- #attributes: (optional, array) HTML attributes to ...
- #value: (optional, string) The textual content of the tag.
...
Not sure if that is better? maybe.
boolean -> Boolean
twig -> Twig
I think I would format this as:
(array) The variables...
Also twig -> Twig
This is a bit ... unclear or garbled?
Maybe say:
Each variable may either be a string value or a render array.
(if that is the correct meaning)
Example is misspelled. Also did we say "Usage Example" (title case) or "Usage example" (sentence case) in the previous patches?
Remove extra space after . [By the way, I recognize this habit from learning typing back in 8th grade, AKA the Dark Ages. ;) ]
I guess that's a typo and it should be \Drupal\Url .. or isn't there another component to that namespace?
It can probably also be an external link, which I think is not a path?
SO maybe something like:
An object containing URL information for an internal or external link.
?
see => See and this last line should probably end in .
This one should have a usage example?
No docs of properties here? It seems at least a pointer to the base Link element would be useful, and if there is a default link text, we should mention that here?
It seems like we should mention on all of these properties that you normally don't have to provide values for them, or what their default values are? This is only currently mentioned on #element and it's kind of implied by the usage example, but I think it would be good to state it.
Also #quantity ... this could be confusing. Is it the max number of links to create or the number of pages that exist from the query?
Also under #route_name, needs comma before "which"... and does providing this or not providing it make the page more cacheable?
Missing the "Usage example" header.
What is this being used for? Probably needs property documentation above.
Comment #8
metzlerd CreditAttribution: metzlerd commentedThanks for the review!
I removed the #id => false reference. It was copied from a core code snippet, but wasn't really used consistently throughout core, so I don't really understand when it's advisable or not. Other changes addressed (hopefully).
The tact I'm trying to take is to list (type, optional) for anything that doesn't have a default value. I guess we should try to decide whether we should clean this up in the editorial phase cause I don't think all the docs are consistent in this regard.
Let me know what you think.
Comment #9
metzlerd CreditAttribution: metzlerd as a volunteer commentedComment #10
jhodgdonLooking better!
By the way I'm out the next 3 weeks so no reviews for a while... you may be able to recruit Tim Plunkett or someone like that to review patches in the meantime.
A few minor questions/suggestions:
this line went over 80 chars. Wrap.
Probably in () we should use the types syntax we use for @param and @return, which would say:
(bool, optional)
See https://www.drupal.org/node/1354#types
In regular text, "Boolean" is correct though.
The others now say "Usage example" not "Usage Example".
I wonder if we should say "to substitute into" rather than "available for use" ... or something like that?
be string => be a string
[did I do that? :) ]
Should we put #title into the usage example?
Hm. So we're passing in a URL object... are #options still relevant?
Defaults => defaults
In the 2nd line here, the . should be before the )
Actually though, we normally don't put (Defaults to ...) in parens in other docs.
I think "By" should be removed?
Extra space after the . in this line.
And again, I'm confused about whether using the default or providing a different route makes the page more cacheable.
What does this mean?
Comment #11
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #12
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedDone as suggested.
Comment #13
rakesh.gectcr@snehi,
Please try to work on the unassigned issue. There are lots of un assigned issues are available in the queue. It is assigned to some one , that means he is working on it, Please understand. You are doing this for many times. I found out in couple of issues.
Disadvantage: Somebody is assigned , they will be really following up that issues. Time is precious, should not end in wasting time of any contributors. Please do understand.
Comment #14
heykarthikwithu@snehi, push the patch changes of
/core/modules/user/src/PrivateTempStoreFactory.php
/core/modules/user/src/SharedTempStoreFactory.php
/core/modules/user/src/Theme/AdminNegotiator.php
to another issue, since they are part of user module (
core/modules/user/src
) and else other are part of/core/lib/Drupal/Core
.Having different patches for different modules will be more readability while pushing changes.
Comment #15
snehi CreditAttribution: snehi as a volunteer and at Publicis Sapient for Publicis Sapient commentedComment #16
metzlerd CreditAttribution: metzlerd as a volunteer commentedRegarding review in comment #10:
8. The #options are still merged into the link that gets rendered. Look at the comments to the preRenderLink and let me know what to do. I took them out, but am a bit nervous about whether it's the right approach.
10. I refactored the description. I don't really think this element is useful unless you're adding pages under admin. I know what functionality it's tied to but experimentation showed that it doesn't work as a stand-alone element for use on other pages. It may still be useful within the context of administration added by other modules, but I'm not really sure. If anyone knows more, I'd love clarification.
I removed the user module patches introduced by #12, and changed the approach to link title but otherwise used that patch, so thank you @snehi
Comment #17
jhodgdonThanks for the patches! Sorry for the delay in reviewing -- I've been on vacation and no one else, unfortunately, ever reviews docs patches. :(
Anyway, this is looking really good! A few very minor fixes could be done:
typo: between
Also this should probably say (optional, int)
This should also be marked (optional) right?
link => a link
Comment #18
rakesh.gectcrComment #19
rakesh.gectcr@jhodgdon,
I have updated the patch according to your comments.
Comment #20
jhodgdonThanks for the new patch! Almost there...
Good. But this line is now over 80 characters, so it needs to be rewrapped.
Here too.
Comment #21
rakesh.gectcrComment #22
rakesh.gectcr@jhodgdon,
Sorry , i could have been noticed that at the first place before uploading previous patch.
Comment #23
jhodgdonThanks!
Oops. This was two sentences in the last patch -- needs . after links and the Defaults should be capitalized to start a new sentence.
Comment #24
rakesh.gectcr@jhodgdon sorry again , I --previous patch and went back to #19.
changes done. :)
Comment #25
jhodgdonThanks! This all looks right to me now.
Comment #26
alexpottCommitted 2cc3c86 and pushed to 8.0.x and 8.1.x. Thanks!
Comment #29
darkdimHi guys,
How to add a class to tag in an element "more_link"?
What to do to use the hook?
Comment #30
jhodgdon@darkdim -- this issue is closed. Please file a new issue... except if you are looking for programming support, the Drupal Core issue queue is not a great place to find it. Although you can create issues in Drupal Core and mark the category as "support request", we don't really handle support requests in the Drupal Core issue queue as a regular practice (that option is mostly there for filing support issues for contributed modules and themes).
There are several support options listed if you click on "Support" at the top of Drupal.org, which will take you to:
http://drupal.org/support
There you can find out about the Drupal IRC and Slack channels, and the Forums, which are our two main support mechanisms in the Drupal community. You might also try http://drupal.stackexchange.com/
Good luck with your issue!
Comment #31
darkdim@jhodgdon Thank you! Sorry