Create link with asciidoctor that has an ID - asciidoctor

I would like to create a external link with an ID using asciidoctorj. I couldn't find anywhere in the manual a way on how to do it.
Asciidoctor Source:
http://stackoverflow.com[Cool Site, id="myId"] ...
Current result:
Cool Site ...
Expected result:
<a id="myId" href="http://stackoverflow.com">Cool Site</a> ...

I don't think it's possible (for now): http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#links
But you can define role to produce HTML class, for example:
http://discuss.asciidoctor.org[Discuss Asciidoctor, role="external"]
will produce:
Discuss Asciidoctor
You can also open an issue here to ask for it!

Related

Add an custom link to the MODX Evolution DLmenu

I'm trying to add a custom link to the menu on MODX Evolution by using DLMenu snippet. Menu displays pages, and after the second point I need to add an anchor link on the main page ... is it possible to somehow implement this at the template level, or apply certain filters?
Thanks for the help,
Alexey
Please share your DLMenu snippet call. If I understand correctly you need to use rowTpl/ rowHereTpl parameters, please use chunk here instead INLINE code and specify the next (snippet If is used):
<li[+classes+]>[+title+]</li>
[[if? &is=`[+iteration+]:=:2` &then=`<li>Home</li>`]]

Use a Tag as Page Title in Kentico

I have a tag cloud on product listing pages on my site that goes to a tag results page which displays products that contain that chosen tag. I want to put a header at the top of that results page that says something like "Products Tagged As: (insert tag name here)"
Any advice? I can't seem to access the system variable that displays the currently chosen tag name. The page URL contains the tagID variable, if that helps:
Product-Features.aspx?tagid=36
I am using Portal Engine Kentico development, by the way. Thanks.
I know this question has been asked a while ago. But I am posting my answer just in case if anyone come across this question they can use this snippet.
Try using following macro
{%tag="";foreach(g IN SiteObjects.TagGroups){foreach(t IN g.Tags){if(t.TagID=ToInt(QueryString.tagid)){tag=t.TagName;}}}return tag;%}
Note: I am using Kentico Version 9.0
For some reason the macro doesnt work in page template directly, I put the above macro in a Static Text webpart its worked like a charm.
Hope it would help someone like myself.
Regards,
Gopala
Use following macro:
{% GlobalObjects.Tags.Where("TagID = " + ToInt(QueryString.GetValue("tagid", 0))) %}

EE alternative to WordPress shortcodes?

Any way in Expression Engine to simulate Wordpress' shortcode functionality?
I want to abide by community rules, and there's a disclaimer when clicking in the "answer" section of an existing question that says I should actually ANSWER the question, not respond to other answers.
As such, I have the same question as the one above. I am a dev with roots in WordPress and I would like to mimic the behavior of WP shortcodes in Expression Engine. All I want to do is save a snippet of code as a template that can be re-used all across my site.
For example, if I want to use an accordion menu on several pages, I could just click click while editing a page and the code appears with placeholder content that the user/dev can then replace with real content). Do I need a graphic slideshow? Click click, define the images/headings/text overlays.
As I'm posting this, I'm about to scour the EE plug-ins library but since I haven't found anything before, I wanted to post here first.
I cover an approach that I've used before in http://www.tyssendesign.com.au/articles/cms/more-stash-examples/ along with a couple of other examples of using Stash.
Short answer: there is not such a thing ... yet. The Shortcode add-on is currently in beta.
Long answer for now: use custom fields. Example: a Matrix field for your accordion, with your columns defined, and add as many row as you like. Then add tags for that in your template.
Same with a Gallery - create a Gallery field (Matrix works great for this again), then add the code to your template to build the gallery.
If these fields are made optional, then they only appear on the front-end when used.
If you want to get fancy and inject these chunks of content into your main content area, you can use NSM Transplant to do so.
Here's a simplified snippet of code I use on one site to acheive this:
{exp:nsm_transplant:body}
{inline_media}
{exp:nsm_transplant:content id="media_{row_count}"}
<figure class="{alignment}">
{exp:ifelse parse="inward"}
{if image}
{if "{alignment}" == "aligncenter"}
{exp:ce_img:make src="{image:resized}" width="860" quality="80" output='<img src="{made_url}" alt="" />'}
{if:else}
{exp:ce_img:make src="{image:resized}" width="430" quality="80" output='<img src="{made_url}" alt="" />'}
{/if}
{if:elseif video}
{if "{alignment}" == "aligncenter"}
{exp:antenna url="{video}" max_width="860"}
{if:else}
{exp:antenna url="{video}" max_width="430"}
{/if}
{if:elseif gallery}
{gallery}{embed="galleries/_embed" entry_id="{entry_id}"}{/gallery}
{/if}
{if caption}<figcaption>{caption}</figcaption>{/if}
{/exp:ifelse}
</figure>
{/exp:nsm_transplant:content}
{/inline_media}
{content}
{/exp:nsm_transplant:body}
In this case authors use {media_1}, {media_2} etc, to embed photos, videos, and galleries inside the content.
Another solution you can look at is Content Elements, which allows a more freeform method of populating an entry with a single custom field.
Hope that helps!
You can also use global variables within EE templates. You cannot use EE tags inside templates, but global variables do work. So anything that you can save as a global variable (possibly including variables made with the addon Low Variables, but I have not verified that) can be included into an EE template.
So if you need static HTML, or images, or whatever, you can absolutely mimic quite a bit of shortcode functionality by creating global vars and invoking them using the ordinary {global_var_name} syntax inside an entry field. Note that EE tags inside global variables will not get parsed, though, so you cannot use this to do an end run around parsing restrictions!

Include Login Side Box which uses the Secure Module -- Play Framework

I'm working on this for days now and I just can't figure it out..
My question is: Is it possible to alter the login.html file in the view.secure folder, so that I could include it in another html-file with #{include 'views/login.html'}, let's say in the index.html, as a login-sidebox, and how could this work?
Move the code to a tag. Simply move the file "login.html" under tags folder, and then you can use it as:
#{login /}
That said, be careful. I don't have the code here but it may be that login is using some vars. If that's the case, you'll need to pas the vars to the tag and modify the tag slightly. For example, assume you have a var called "name" in the tag. You'll have to change "name" to "_name" in the tag and pass the var as parameter in the tag, as follows:
#{login name:name /}
This is the standard behavior of tags. You can check existing tags in the "samples" folder of the framework for more help.
Probably with #{extends 'index.html' /} combined with #{doLayout /} as shown in documentation.
With all of your friendly assistance i solved the problem!
I included the login-form into all sites i want it in, and when I get logged in or logged out, I use the onAuthenticated()/onDisconnected() to redirect to the wanted site!
But there is one problem left! If the case appears that a error message is displayed, like "User not existing" or something, it is not possible to handle that case.. it would be nice if you could also help me with that.

Where can I find discussion board newform.aspx page to modify?

I have to modify text in discussion board new post page. Now it is showing "Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval."
I have to append some text to this message. I am trying to find discussion board newform.aspx page to modify. Please let me know where can I get that?
Assuming your discussion list is called "Public Discussion" at a site called "http://yoursite"
Connect to the site (http://yoursite) with sharepoint designer
Go to All Files -> Lists -> Public Discussion -> NewForm.aspx
Edit file
Look for <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
Add content as needed
Save file, it will warn you that you are about to save a customised layout.
The message you describe is injected by sharepoint's content approval framework. To custom the messsage, you will most likely need to use javascript to find the message box and change the text.
On my site the html xpath to the node is something like this:
//span[#id='part1']/table/tbody/tr/td[2]
On the file system it will be here:
$sphome / "Name of your discussion board" (this will be a folder) / Forms / newform.aspx
There is a similar question asked here. It describes custom template controls handle the display of this content.
There is also a link here that describes a solution to do this using css. This would allow you to hide the OOB text and then have your own content displayed instead. However, there is some question of it working on broswers other than IE so include this in your testing.

Resources