Hi Zaphod

I’ll pick up the end of your comments first:

> Sorry in advance if my questions sound dense, but I've seen some amazing 
> things accomplished by your wonderful creation, and find it hard to believe 
> that this simple 'feat' is this hard to overcome.

First, it’s positively encouraged to ask questions here. It’s when people 
engage in back and forth discussion that knowledge and techniques get teased 
out, here in the open where anyone can join in. There’s a good chance that 
while I’m typing this somebody else will dive in with ready-to-use code for the 
needs you describe.

Secondly, addressing why this apparently simple feat is hard to achieve. 
There’s a double whammy here: what you want to do is not directly supported by 
the core, which means that there is no ready-to-use mechanism. The second part 
is that what you want to do is in the domain of CSS. The trouble here is that 
understanding CSS requires an understanding of HTML, and both are quite 
complex. TiddlyWiki does a little to ease writing CSS, but it doesn’t really 
attempt to hide the true, horrific nature of CSS.

So, as a beginner you’ve got the complexities of CSS/HTML and TiddlyWiki 
multiplied together, and therefore quite a mountain to climb to implement 
relatively complex new features.

As I said at the beginning, there’s a good chance that someone else in the 
community can help with your immediate needs, as they have in other threads. 
But the best response to the situation may be to keep on digging into 
TiddlyWiki, and learn as much as you can by example :)

Anyhow, in particular, you’ll need to understand transclusion, and the way that 
it is used in stylesheets to fully implement the solution. But a key part is 
that the CSS syntax for using an external image as a background is different;

background-image: url(http://www.example.com/bck.png);

So, if you’ve got the image URL readily accessible, it’s pretty easy to set the 
background colour for an element.

Best wishes

Jeremy



> On 22 Jul 2016, at 16:00, Zaphod Beeblebrox <[email protected]> wrote:
> 
> Thank You so much for the quick reply, Jeremy :)
> 
> 
> On Friday, July 22, 2016 at 6:44:49 AM UTC-4, Jeremy Ruston wrote:
> Hi Zaphod
> 
>> This is for a movie database of sorts that I'm working on. Each tiddler is a 
>> different movie, with synopsis, screenshots,  posters/dvd covers, etc. Today 
>> I would like to accomplish two things:
>> Have a pre-selected screenshot come up as the background image for the page 
>> whenever the tiddler is opened;
> This is a complicated requirement, and not easy to achieve. There’s nowhere 
> else in the core or elsewhere that we have a similar technique of making a 
> global style change in response to a particular tiddler being opened.
> 
> The approach I would suggest would be to use the current tiddler field of the 
> $:/HistoryList tiddler to transclude an image tiddler. You’d have to arrange 
> the titles of the image tiddlers to be related to the titles of the tiddlers 
> you’re viewing (eg adding `-image` on the end).
> 
> I've had a look at the $:/HistoryList tiddler (and while investigating it I 
> find that the "colours" tiddler from my previous example was a JSON tiddler 
> (hence the quotation-mark formatting), but I'm no closer to a solution - I'd 
> need more detailed instruction to implement your suggestion.
> 
>> Also have a drop-down list available (perhaps in the SideBar) with links to 
>> external graphics (the pre-selected screenshots from all/most of the movies, 
>> listed as the movie's title) that the user can choose from and it will 
>> immediately become the background image of the page.
> That’s a good deal easier - you can see something very similar in the Theme 
> Tweaks tab of Control Panel. You can copy the code from there and just modify 
> the filter of images to limit it to your screenshot tiddlers.
> 
> Okay, now this looks much more do-able (or so I thought...).
> 
> Just been playing with the 
> $:/themes/tiddlywiki/vanilla/settings/backgroundimage, and while it can pick 
> up and display any internal graphics that are stored in base64 format 
> tiddlers within the TW, I need to access external images from the Internet. 
> Once in use, the TW will have well over 1000 tiddlers with heavy use of html 
> (each 'movie' tiddler weighs between 20-50kb), and with screenshots of 
> 20-100kb each (that grow exponentially once converted to base64), it's just 
> not feasible to store them as tiddlers.
> 
> I have tried directly inserting the image address, using 
> "[img[ImageAddress]]", html "<img src="ImageAddress">" and also creating a 
> tiddler with any of the above in it and using its title, but none of them 
> seem to work...
> 
> Help me to understand - What --exactly-- makes the 
> $:/themes/tiddlywiki/vanilla/settings/backgroundimage tiddler work like it 
> does, enabling it to globally change the background immediately?
> And by extension, why can't we use it by setting its value (a link to an 
> external image), just as is done through the ControlPanel section, only from 
> within each 'movie' tiddler when that tiddler is opened?
> 
> Sorry in advance if my questions sound dense, but I've seen some amazing 
> things accomplished by your wonderful creation, and find it hard to believe 
> that this simple 'feat' is this hard to overcome.
> 
> --Zaphod
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywiki 
> <https://groups.google.com/group/tiddlywiki>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/0eb6255a-18b6-4504-9919-2afeafa5cc79%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/0eb6255a-18b6-4504-9919-2afeafa5cc79%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0BF271A4-6C26-4E27-8EFE-911E382B226B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to