Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-02-13 13:45:49

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

[Textile] Figures and figcaptions

I would love to see an addition to the Textile arsenal for figure and figcaption in combination with one another. I use them all the time.

A typical HTML combination…

<figure class=“foo”>
<img src=”“ title=”“ alt=”“>
<figcaption>Cow jumping over moon.</figcaption>
</figure>

Hypothetical idea as Textile…

fig(foo). {Cow jumping over moon.}!http://domain.tld/images/60.jpg!

Or…

fig(foo). !http://domain.tld/images/60.jpg!{Cow jumping over moon.}

Or…

fig(foo). !http://domain.tld/images/60.jpg{Cow jumping over moon.}!

I don’t really care how, just that it would be possible.

Where’s our Textile wizard?

Offline

#2 2014-02-13 15:04:20

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: [Textile] Figures and figcaptions

This should be posted here for discussion by Textile’s developers.

Offline

#3 2014-02-13 15:38:00

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: [Textile] Figures and figcaptions

Hi Destry,

Now, the role of the forum is limited.

Now, to be a member of the Textpattern community. must
  • Having an account on this forum ESSENTIALLY to ask for help.
  • Have a Github account for report bug or propose ideas for textile.
  • To propose Tips, It’s via TxpTips website. But you lost ability to edit and evolve your tips, and for open discussion it’s only via “big brother Discuss”.
  • And if you do not read or write English, Textpattern is definitely no longer for you.

Yes, I need time to accept these changes, but it’s okay :)

Offline

#4 2014-02-13 16:03:29

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [Textile] Figures and figcaptions

@Phil: Thanks. Wasn’t sure where that had redirected to.

Offline

#5 2014-02-13 16:15:02

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: [Textile] Figures and figcaptions

@sacripant

  1. This has always been the case – the forum has always required an account in order to post. You also have the Google+ community page as a way to ask for help, or via Twitter.
  2. Textile is in no way affiliated with Textpattern (it branched off years ago and has separate devs now – apart from Jukka who is on both projects) – so if you have a problem with them using GitHub then you’ll have to contact them.
  3. I have no issue with people posting tips on the forum – it’s OK with me.
  4. The multi language forums/documentation are a result of focussing our limited resources as best we can. As has already been stated, this situation may change in the future once the new documentation site (and other sites) are brought up to date. We have to start somewhere.

Offline

#6 2014-02-13 16:48:32

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [Textile] Figures and figcaptions

For the record, it’s been added here

Steve hasn’t dropped in that thread for 3 years, so I’m not holding my breath.

Good ol’ html it will continue to be.

Offline

#7 2014-02-13 17:02:14

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,134
GitHub

Re: [Textile] Figures and figcaptions

Destry: I might be misunderstanding, but this implies there’s some HTML5 support in the patch mentioned here – any use?

Offline

#8 2014-02-14 00:30:56

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [Textile] Figures and figcaptions

sacripant wrote #278922:


  • To propose Tips, It’s via TxpTips website. But you lost ability to edit and evolve your tips, and for open discussion it’s only via “big brother Discuss”.

Actually that’s not correct. Technically all authors have a freelance user login to TXP Tips and could edit their own tips or tutorials over time. In practice that has not happened so far but an author can do so if he/she wants.

As for Disqus, its just a tool. What else would you propose? The purpose is simply to provide a way for users to place a comment or question related to that particular tip.

For general tips, if users want to post their tips and tricks on the forum they may do so, but that really defeats the purpose of having a dedicated tips site for Textpattern community users.

Offline

#9 2014-02-14 06:41:30

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [Textile] Figures and figcaptions

gaekwad wrote #278929:

Destry: I might be misunderstanding, but this implies there’s some HTML5 support in the patch mentioned here – any use?

Yeah, I cam across a thread for that in Github too. Not recommended for production sites, or so it said. And it all looks like Greek to me anyway. I guess the problem is that figure and figcaption are both block elements and you can’t easily combine them in a single line Textile statement.

Writing an actual figure in HTML is pretty easy, and my collaborators will probably be able to remember that better than some weirdly-invented Textile solution for the sake of it.

Oh well.

I just remembered, Bloke made a really cool macro for figures/figcaptions for the magazine. A single macro tag input that pulls (via image ID) the image and it’s alt and caption from Txps’s image meta fields. Super sweet. That would be the ideal way to do it, because it actually makes use of the meta fields. Oh, and he made it so you could use Textile inside the caption field. Pretty sweet.

Offline

#10 2014-02-14 08:25:52

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: [Textile] Figures and figcaptions

The default theme that ships with Textpattern has figure/figcaption support – you just call it via a <txp:images> tag.

Offline

#11 2014-02-14 10:21:13

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: [Textile] Figures and figcaptions

Wow, image_info tag? Introduced v 4.3.0? I need to pay better attention to tag releases.

Thanks, Phil. So I should be able to whip that variable up from scratch, I guess.

Offline

#12 2014-02-14 10:33:07

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: [Textile] Figures and figcaptions

Just to clarify, so people don’t need to decipher the GitHub file…

Put this tag in an article…

notextile. <txp:images id="xx" form="images" />

Where xx is the id number of the image you want to use.

Then create this ‘misc’ type form called images:

<!-- set up a variable to check whether a image also has a caption associated with it... -->
<txp:variable name="caption" value='<txp:image_info type="caption" />' />

<!-- ...now use that image caption and wrap img inside a figure with figcaption tags, otherwise just use a plain img tag -->
<txp:if_variable name="caption" value="">

<!-- image - overriding the width and height to let the image scale to fit parent container -->
    <p itemprop="image"><txp:image width="0" height="0" /></p>

<txp:else />

    <figure itemscope itemtype="http://schema.org/ImageObject">

<!-- image - overriding the width and height to let the image scale to fit parent container -->
        <span itemprop="image"><txp:image width="0" height="0" /></span>

<!-- you do not need to specify the attribute type="caption" as that is the default setting for <txp:image_info /> tag -->
        <figcaption itemprop="caption"><txp:image_info type="caption" /></figcaption>

    </figure>

</txp:if_variable>

That checks whether image has a caption, and if so uses the figure and figcaption structure, otherwise just outputs a standard image structure. It also has Schema markup in there which describes the content, in case you’re wondering what the itemtype, itemprop, etc. stuff is.

Obviosuly you can delete the HTML comments in your final production files, they are just to tell you what each bit does.

Edit: added notextile. to stop paragraph <p> tags from wrapping the <figure> (which would be incorrect, as figures are block level elements).

Last edited by philwareham (2014-03-03 10:24:36)

Offline

Board footer

Powered by FluxBB