Template:HnH forum link: Difference between revisions
Jump to navigation
Jump to search
m (+nts) |
m (+Add a little bit of separation for line-wrapped boxes. (+0.1 above default used line-height).) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
border-radius: 0.15em; | border-radius: 0.15em; | ||
padding: 0.05em 0.2em; | padding: 0.05em 0.2em; | ||
line-height: 1.7em; | |||
">{{#switch: x | ">{{#switch: x | ||
| {{#if: {{{aps|}}} |x}} = HnH Post-link: [ | | {{#if: {{{aps|}}} |x}} = HnH Post-link: [//www.havenandhearth.com/forum/viewtopic.php?{{{aps}}} {{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}{{#if:{{{date|}}}| (<i>{{{date}}}</i>)}}] | ||
| {{#if: {{{f|{{{forumid|}}}}}} || | | {{#if: {{{f|{{{forumid|}}}}}} || | ||
Line 16: | Line 17: | ||
{{#if: {{{p|{{{postid|}}}}}} ||x}} | {{#if: {{{p|{{{postid|}}}}}} ||x}} | ||
}} | }} | ||
}} = HnH Fora-link: | }} = {{error|missing post-id|HnH Fora-link: }} | ||
| {{#if: {{{p|{{{postid|}}}}}} || | | {{#if: {{{p|{{{postid|}}}}}} || | ||
Line 22: | Line 23: | ||
{{#if: {{{t|{{{topicid|}}}}}} ||x}} | {{#if: {{{t|{{{topicid|}}}}}} ||x}} | ||
}} | }} | ||
}} = HnH Fora-link: | }} = {{error|missing topic-id|HnH Fora-link: }} | ||
| {{#if: {{{p|{{{postid|}}}}}} || | | {{#if: {{{p|{{{postid|}}}}}} || | ||
Line 28: | Line 29: | ||
{{#if: {{{f|{{{forumid|}}}}}} ||x}} | {{#if: {{{f|{{{forumid|}}}}}} ||x}} | ||
}} | }} | ||
}} = HnH Fora-link: | }} = {{error|missing forum-id|HnH Fora-link: }} | ||
| {{#if: {{{p|{{{postid|}}}}}} |x}} = HnH Post: [ | | {{#if: {{{p|{{{postid|}}}}}} |x}} = HnH Post: [//www.havenandhearth.com/forum/viewtopic.php?p={{{p|{{{postid}}}}}}#p{{{p|{{{postid}}}}}} {{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}{{#if:{{{date|}}}| (<i>{{{date}}}</i>)}}] | ||
| {{#if: {{{t|{{{topicid|}}}}}} |x}} = HnH Topic: [ | | {{#if: {{{t|{{{topicid|}}}}}} |x}} = HnH Topic: [//www.havenandhearth.com/forum/viewtopic.php?f={{{f|{{{forumid}}}}}}&t={{{t|{{{topicid}}}}}} {{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}{{#if:{{{date|}}}| (<i>{{{date}}}</i>)}}] | ||
| {{#if: {{{f|{{{forumid|}}}}}} |x}} = HnH Forum: [ | | {{#if: {{{f|{{{forumid|}}}}}} |x}} = HnH Forum: [//www.havenandhearth.com/forum/viewforum.php?f={{{f|{{{forumid}}}}}} {{#if:{{{title|}}}|<b>{{{title}}}</b>|<i>no title</i>}}] | ||
| | | {{error|???}} | ||
}}</span></includeonly | }}</span></includeonly | ||
Line 45: | Line 46: | ||
* '''t''' or '''topicid''': topic-id in forum. (''needs f/forumid parameter'') | * '''t''' or '''topicid''': topic-id in forum. (''needs f/forumid parameter'') | ||
* '''p''' or '''postid''': post-id of post. (''see yellow-icon at top-right corner of related post'') | * '''p''' or '''postid''': post-id of post. (''see yellow-icon at top-right corner of related post'') | ||
* '''title''': Optional, title | * '''title''': Optional (''well kinda''), title or other short remark. Defaults to "''no title''" (any "|" character in the title need to be changed to <code>&#x7C;</code>) | ||
* '''date''': Optional. (''but useful in the long run, especially the year'') | * '''date''': Optional. (''but useful in the long run, especially the year'') | ||
Line 106: | Line 107: | ||
| <code><nowiki>{{HFL|t=45128}}</nowiki></code> | | <code><nowiki>{{HFL|t=45128}}</nowiki></code> | ||
| => Foo {{{{PAGENAME}}|t=45128}} bar. | | => Foo {{{{PAGENAME}}|t=45128}} bar. | ||
|- | |||
| | |||
|- | |||
| <code><nowiki>{{HFL|p=586368|title=Foo &#x7C; Bar}}</nowiki></code> | |||
| => Foo {{{{PAGENAME}}|p=586368|title=Foo | Bar}} bar.<!-- | |||
|- | |||
| <code><nowiki>{{HFL|p=586368|title=Foo &#124; Bar}}</nowiki></code> ... (fails) | |||
| => Foo {{{{PAGENAME}}|p=586368|title=Foo | Bar}} bar. | |||
|- | |||
| <code><nowiki>{{HFL|p=586368|title=Foo {{!}} Bar}}</nowiki></code> ... (fails). | |||
| => Foo {{{{PAGENAME}}|p=586368|title=Foo {{!}} Bar}} bar. --> | |||
|} | |} | ||
<noinclude> | <noinclude> |
Latest revision as of 11:31, 17 January 2023
- Parameters
- f or forumid: sub-forum-id in HnH fora.
- t or topicid: topic-id in forum. (needs f/forumid parameter)
- p or postid: post-id of post. (see yellow-icon at top-right corner of related post)
- title: Optional (well kinda), title or other short remark. Defaults to "no title" (any "|" character in the title need to be changed to
|
) - date: Optional. (but useful in the long run, especially the year)
- aps: Optional. Alternative Parameter String. (allows for direct input of any fora (viewtopic) parameters) (overwrites f, t and p input)
- PS: Do strip the "sid" parameter if its in your link. Its a tracker thing, and has no practical use here at RoB, ... other than to bloat the aps string.
- Notes
- Not supporting forum "start" parameter. Use post-id variant for that.
- Forum-id and topic-id parameters are ignored when post-id parameter is used.
- Not sure if Forum-link on its own is that useful. (ie: forum-link without topic-id) (included as fallback variant)
- HFL redirect not active yet (ie: use long name for testing)
- Usage/Preview/Debug
{{HFL|f=39}}
|
=> Foo HnH Forum: no title bar. |
{{HFL|f=39|title=Announcements}}
|
=> Foo HnH Forum: Announcements bar. |
{{HFL|f=39|t=45128}}
|
=> Foo HnH Topic: no title bar. |
{{HFL|f=39|t=45128|title=Le Petit Fix}}
|
=> Foo HnH Topic: Le Petit Fix bar. |
{{HFL|f=39|t=45128|title=Le Petit Fix|date=2015-11-10}}
|
=> Foo HnH Topic: Le Petit Fix (2015-11-10) bar. |
{{HFL|p=586368}}
|
=> Foo HnH Post: no title bar. |
{{HFL|p=586368|title=Le Petit Fix}}
|
=> Foo HnH Post: Le Petit Fix bar. |
{{HFL|p=586368|title=Le Petit Fix|date=Nov 10, 2015}}
|
=> Foo HnH Post: Le Petit Fix (Nov 10, 2015) bar. |
{{HFL|aps=f=39&t=45128&start=10#p586381|...
|
=> Foo HnH Post-link: title (date) bar. |
{{HFL}}
|
=> Foo HnH Fora-link: missing post-id bar. |
{{HFL|t=45128}}
|
=> Foo HnH Fora-link: missing forum-id bar. |
{{HFL|p=586368|title=Foo | Bar}}
|
=> Foo HnH Post: Foo | Bar bar. |