I have a page in my Wiki (v5.1.17) that is supposed to auto-generate a list of links to tiddlers that need some sort of follow up. What shows up is whatever fulfils one of two criteria: tagged "needs_followup", or title begins with "/followup/".
Here is my code:
<$list filter="[prefix[/followup/]] [tag[followup_needed]] +[sort[title]]" variable=entry>
<$link><<entry>></$link><br/>
</$list>
The list of items works fine actually, except that they're not clickable links. They look like links -- blue and underlined -- but clicking on one doesn't actually do anything. Can anyone please tell me what I'm doing wrong?
The list of items works fine actually, except that they're not clickable links.
The problem arises because you have changed the variable in which the list widget stores titles. Usually the list widget stores the current title in a variable named <<currentTiddler>>:
This variable name is well known by other widgets, e.g. the link widget will look for this variable when no to attribute is specified.
However, your list widget instance stores the current title in a variable named entry, which is not understood by the <$link> widget.
They look like links -- blue and underlined -- but clicking on one doesn't actually do anything.
Actually, they are "real" links and also navigate once clicked: The link widget will resolve the tiddler where your code is in as <<currentTiddler>> and try to link to this tiddler (which looks like it is not linking at all because you probably have no scroll effect).
Can anyone please tell me what I'm doing wrong?
Solution 1) Hence the solution is to add the to-attribute and set it to <<entry>>:
<$list filter="[prefix[/followup/]] [tag[followup_needed]] +[sort[title]]" variable=entry>
<$link to=<<entry>>><<entry>></$link><br/>
</$list>
Solution 2) Instead of setting to you could also do the following:
<$list filter="[prefix[/followup/]] [tag[followup_needed]] +[sort[title]]" variable=entry>
<$set name="currentTiddler" value=<<entry>>>
<$link><<entry>></$link><br/>
</$set>
</$list>
Solution 3) Or you could remove the variable=entry altogether
<$list filter="[prefix[/followup/]] [tag[followup_needed]] +[sort[title]]">
<$link><<currentTiddler>></$link><br/>
</$list>
Offtopic: you may also want to use the $view widget to render the title to avoid auto wikification of PascalCase titles as links: <$link to=<<entry>>><$view field="title" /></$link>
Related
Currently I'm trying to create a macro. The macro will be used within a $list widget which will cycle through a collection of tiddlers (chosen as per certain filter criteria which themselves aren't relevant here).
Within the above $list widget, for each tiddler, the macro will go through all of the fields of the tiddler that have a certain prefix (which is "link_"). These fields contain as their value internet URLs.
Not only do I wish to display these URLs (for each tiddler) as a list, I wish them to act as hyperlinks to said URLs.
Now so far the below macro has worked for the moment:
\define myMacro(prefix:"")
<$list filter="[fields[]prefix[$prefix$]sort[title]]" variable="fieldName">
<$transclude field=<<fieldName>>/>
</$list>
\end
What the above does is simply print the value (the URL) of that field while making sure it also acts as a hyperlink to that particular URL.
BUT
I wish to improve this further. Instead of the text of those links being the link itself, I want it to be a custom text.
For eg:
https://en.wikipedia.org/wiki/Computer_programming
vs.
Computer Programming (hyperlink to the same page but with custom hyperlink text)
But doing the above is seemingly impossible with the above $transclude method unless there is a way of using the output of a widget itself as a value.
I've already checked something direct like:
[[Custom link name|<$transclude field=<<fieldName>>/>]]
or
<a href=<$transclude field=<<fieldName>>/> >Custom link name</a>
Doesn't work.
I've tried other methods too but they don't work. How do they not work?
Let's say there is a variable in that particular tiddler called list_1 and it's value is https://en.wikipedia.org/wiki/Computer_programming. I wish to use the https://en.wikipedia.org/wiki/Computer_programming as the href value of an <a> tag.
But with all the methods I've tried, at best I can access the value list_1 itself via <<fieldName>>.
Only the $transclude method itself allows me to use the value of list_1 itself (ie https://en.wikipedia.org/wiki/Computer_programming), but it doesn't allow you AFAIK to use it as a value in an another wikitext expression.
So how do I achieve my aforementioned objective? Is there a way to use the output of a widget itself as a value for another wikitext expression or is there some other way to accomplish my objective?
Thanks in advance.
not sure I understand your goal but this is definately wrong:
<a href=<$transclude field=<<fieldName>>/> >Custom link name</a>
you should use the <$link widget to create links and a filter for attribute values
<$link to={{{[[title]get<fieldName>]}}}>Custom link name</$link>
or
<$link to={{{[<variableWithTitle>get<fieldName>]}}}>Custom link name</$link>
Edit: added title to filter
I'm putting together some TiddlyWiki templates, and I've run into something that would be nice to have, but I'm not sure whether it's actually possible.
I have some tiddlers that I'm including in another tiddler using the tabs macro. Each tiddler has one of two tags associated with it. I'd like to append a snippet of text to the caption in the tab view, based on which tag is associated.
I don't have a strong preference for whether this is done by adding some kind of callback to edit the caption on save, something that somehow calculates the desired caption on the fly, altering the invocation of the tabs macro to recalculate the caption on render, or somehow causing the templates to calculate the caption field.
I haven't found anything promising going through the documentation, but maybe I just haven't figured out what's relevant to my issue. I find that happens a lot.
Like, I'm sure I can write conditionals based on whether the tags exist, but I can't see any way to interpolate text into the caption field based on any kind of computation whatsoever.
For reference, here are my current macro invocations:
<<tabs [list[]] state:$:/state/tabPeriod template:PeriodTemplate>>
<<tabs [list[$(currentTab)$]] state:$:/state/tabEvent class:"tc-vertical" template:"EventTemplate">>
<<tabs [list[$(currentTab)$]] state:$:/state/tabScene template:"SceneTemplate">>
All of these lines are from different templates, that just pull a list of tiddlers and template-transclude them into tabs using the provided template. Currently, the tabs are captioned with the tiddler caption, if defined, and fall back to the title. I'd like to alter the caption, ideally without inserting too much boilerplate into the tiddlers.
I figured out what I need to do differently: I defined a custom macro based on the tabs macro, added the logic, and now it works fine. I basically just changed the current contents of the caption logic to:
<$set name="tv-wikilinks" value="no">
<$transclude tiddler=<<currentTab>> field="caption">
<$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
</$transclude>
<$list filter='[<currentTab>tag[light]]'>
○
</$list>
<$list filter='[<currentTab>tag[dark]]'>
●
</$list>
</$set>
I'm not sure if I'm using the list widget correctly, but it works.
I am trying record selecting a value from a dropdown menu in iMacros for Firefox/Mac. This is what I do:
https://youtu.be/xweQ7XOPbfo
This results in the following macro (the three first lines, which are not of interest, are omitted):
URL GOTO=http://skicka2.posten.se/Sidor/Start.aspx
TAG POS=5 TYPE=INPUT:TEXT FORM=ID:aspnetForm ATTR=* CONTENT=49
The selection in the drowdown named "Välj tjänst" ("select service") should go
between line one and two above, but nothing is recorded, and thus running the macro is pointless.
This appears to be similar to this problem:
Imacros Drop Down Menu
However, that problem did not get any relevant answer (the one person answering it seems to have misunderstood the question).
The issue seems to be simple. You even have two ways to select a certain value from the dropdown. For example:
TAG POS=2 TYPE=SELECT FORM=ID:aspnetForm ATTR=* CONTENT=$PostNord<SP>Parcel
or this:
TAG POS=2 TYPE=SELECT FORM=ID:aspnetForm ATTR=* CONTENT=#7
etc.
If I go TiddlyWiki site I can see tab Content. How can I create my own table of content for my tiddlywiki file?
I found the documentation for this really confusing, but here's what I did that works best:
<div class="tc-table-of-contents">
<<toc-selective-expandable 'TableOfContents' sort[ind]>>
</div>
Then, tag each tiddler with TableofContents.
Lastly, when editing each tiddler, add a new field named "ind" (for index - you can change this to whatever you like, so long as it's not being used elsewhere, of course). Assign a value to "ind" starting with 0 to tell it what order you want the tiddlers to go in. I incremented by 10 instead of 1 in case I want to rearrange a few things or insert more in the middle.
Create a new tiddler and give the title Contents
Under tags, give the value $:/tags/SideBar
Under type the text for this tiddler, give
<$list filter={{$:/core/Filters/AllTiddlers!!filter}} template="$:/core/ui/ListItemTemplate"/>
This is explained in the documentation.
The short version: Add some tag (e.g. Content) to the pages you want to appear in the TOC; then in the place where you want it to appear, use one of the macros with that tag name (e.g. <<toc Content>>). To make a nested TOC, tag pages with the names of tags that appeared at the top level. So for example if you have a tiddler named First that is tagged with Content, then you can tag more tiddlers with First, and they will appear indented below First in the TOC.
I have two pages that should be using the exact same template and layout.
The correct item layout can be seen below.
http://dokha.co/index.php/medwakh/custom-medwakh-from-white-horse-studios-13.html
The incorrect item layout is below.
http://dokha.co/index.php/shisha-tobacco/al-fakher-shisha-tobacco-1.html
As you can see in the first image the layout of the item is compact. In the second link it is all drawn out.
I am curious to know if you can tell me how to make the second one like the first one, The compact style. I am not sure what modifications could have been made in magento to cause the layout to only show up that way for specific items, as only the items in the category on link 1 behave that way, I would like to know how to make them all behave this way.
Ok, first thing: the layouts are slightly different because in the first example, you have simple product and in the second example you have a configurable product.
So, view.phtml is including different templates in each.
Regardless though, the actually culprit of the expanded space you are seeing in the second example is being caused by a clearing div. Simply remove it.
The div you are looking for is this:
<div class="clearer"></div>
and you will find it in app/design/frontend/your_package/your_theme/template/catalog/product/view.phtml