Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#151 2007-01-12 21:22:02

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Re: [plugin] [ORPHAN] zem_image_replace, version 2

I want to use an value from an custom fieldm in this case a font size and the plugin breaks when I try to do so, I tried this:

<txp:zem_ir font="FranklinGothicEC.ttf" wraptag="p" padding="0 3 8 3" wrap="400" size="
<txp:php> "$GLOBALS['thisarticle']['fontsize'] </txp:php>">TEXT</txp:zem_ir>

Does anyone have an idea how to solve this?

Offline

#152 2007-01-13 00:06:46

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

mikkeX:

<txp:php>
echo zem_ir(
  array(
    'font'=>"FranklinGothicEC.ttf",
    'wraptag'=>"p",
    'padding'=>"0 3 8 3",
    'wrap'=>"400",
    'size'=>$GLOBALS['thisarticle']['fontsize']
  ),
  'TEXT'
);
</txp:php>

Last edited by ruud (2007-01-13 00:07:48)

Offline

#153 2007-01-13 07:25:53

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,426
Website GitHub Mastodon

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Another way of using tag values as attributes: asy_wondertag.

Offline

#154 2007-01-13 08:02:47

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Thanks ruud and wet!

ruuds way of doing it is the best for me, but how do you get the output to be the article title?

I tried this:


<txp:php>
echo zem_ir(
  array(
    'font'=>"FranklinGothicEC.ttf",
    'wraptag'=>"p",
    'padding'=>"0 3 8 3",
    'wrap'=>"400",
    'size'=>$GLOBALS['thisarticle']['fontsize'],
  ),
$GLOBALS['thisarticle']['Title']
);
</txp:php>

But that did not work, it just ouputs <>.

Last edited by mikkeX (2007-01-13 08:03:12)

Offline

#155 2007-01-13 11:35:57

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

replace $GLOBALS['thisarticle']['Title'] with title(array())

Offline

#156 2007-01-13 13:51:36

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Re: [plugin] [ORPHAN] zem_image_replace, version 2

ruud wrote:

replace $GLOBALS['thisarticle']['Title'] with title(array())

Great!

One problem left, it is my value from my customfield fontsize, how do I get it in:

<txp:php>
echo zem_ir( array( ‘font’=>“FranklinGothicEC.ttf”, ‘fontsize’=>$GLOBALS[‘thisarticle’][‘fontsize’], //this on does not work ‘wraptag’=>“h1”, ‘padding’=>“0 3 3 3”, ‘ft’=>“1”, ‘wrap’=>“400”,
),
title(array())
);
</txp:php>

Offline

#157 2007-01-13 14:26:03

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

replace 'ft'=>"1" with custom_field(array('name' => 'Custom X')) assuming the ft parameter sets the font size and ‘Custom X’ is the label of the custom field that stores your font size.

Offline

#158 2007-01-13 17:26:20

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,426
Website GitHub Mastodon

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Offline

#159 2007-01-13 19:43:12

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Thanks ruud and wet, I am beginning to understand that is going on, but, I can’t get it to work. Now I have this:

@<txp:php>
echo zem_ir(
  array(
    'font'=>"FranklinGothicEC.ttf",
    'fontsize'=>custom_field(array('name' => 'rubrikstorlek')),
    'wraptag'=>"h1",
    'padding'=>"0 3 3 3",
    'ft'=>"1",
    'wrap'=>"400",
),
title(array()) 
);
</txp:php>@

My custom field is called rubrikstorlek, and it does not put out anything, but the field have the value of 50.

My whole form looks like this:

@<div class="puff">
<txp:mdn_if_custom field="2" empty="1"> <else /> 
<div style="background-color: <txp:rei_show_custom customid="2" />;padding:5px">
  </txp:mdn_if_custom>
<div style="text-align:right;z-index:100"><span class="ingress"> <txp:category1 title="1" /></span>
</div>
<div style="margin:5px 0 5px -3px;z-index:99;width:402px;">
<txp:mdn_if_custom field="3" empty="1"> 
<txp:permlink> 
<txp:zem_ir font="FranklinGothicEC.ttf" wraptag="h1" padding="0 3 3 3" wrap="400" ft="1" aa="1" size="30"><txp:title /></txp:zem_ir>
</txp:permlink>
<else /> 
<txp:permlink> 
<txp:php>
echo zem_ir(
  array(
    'font'=>"FranklinGothicEC.ttf",
    'fontsize'=>custom_field(array('name' => 'rubrikstorlek')),
    'wraptag'=>"h1",
    'padding'=>"0 3 3 3",
    'ft'=>"1",
    'wrap'=>"400",
),
title(array()) 
);
</txp:php>
</txp:permlink>
</txp:mdn_if_custom>
</div>
<div class="teaser2">
<txp:permlink> 
<txp:excerpt />
<span class="lasMer"><strong>L&auml;s mer</strong></span><strong> <span class="lasMerPilar">&gt;&gt;&gt;</span></strong>
</txp:permlink>
</div>
<txp:mdn_if_custom field="2" empty="1"> <else /> 
</div>
  </txp:mdn_if_custom>
	  </div>@

Offline

#160 2007-01-15 11:58:24

mikkeX
Archived Plugin Author
Registered: 2004-02-26
Posts: 74

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Okay I solved it.

Offline

#161 2007-04-24 18:37:59

transph0rmer
Member
From: Europe
Registered: 2004-12-24
Posts: 14

Re: [plugin] [ORPHAN] zem_image_replace, version 2

This question came up in this thread already a few times . Did anybody actually got a validated link working with zem_ir ?
Help’s really appreciated.

Tschüss,
Claus

Els wrote:

First, this is a great plugin, thank you!

I did this:

<code><a href=”/”><txp:zem_ir font=”/html/fonts/CHILLER.TTF” fontsize=“100” color=”#336699” backgroundcolor=”#336699”><txp:page_title /></txp:zem_ir></a></code>

to make it a link to the home page. It works, but the page doesn’t validate anymore because of the h1 tags inside the anchor tags. I tried wraptag=”“, but that doesn’t make the h1 tags disappear.
Is there a way to solve this, or is the plugin just not meant to be used this way?

EDIT: This:

<code><txp:zem_ir font=”/html/fonts/CHILLER.TTF” fontsize=“100” color=”#336699” backgroundcolor=”#336699”><a href=”/”><txp:page_title /></a></txp:zem_ir></code>

seems to create valid html, but it doesn’t give me a working link.

Has anybody found a solution how to fix this? I would really like to have both, zem_ir and valid code with working link.

As Els wrote in his later post, this is not just IE problem. Any way to remove for example the wraptags totally? wraptag=”“ sets it back to default, h1.

Offline

#162 2007-09-12 19:49:40

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Is there any chance to use czech characters? Czech language is problem. Characters like “ěščřžýáíéúů” don’t work. I tried different charsets for html_entity_decode() but without success. I need utf-8 (I tried, didn’t work) but czech characters work well also with win-1250 or ISO-8859-2, but these two are not allowed with html_entity_decode(). Any suggestion?

Offline

#163 2008-01-23 17:59:20

midmood
Member
From: Rome, Italy
Registered: 2007-07-20
Posts: 68
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

hi all,
I have a problem with zem_ir out of my control

as you can see in my site , spaces between words are replaced by a strange digit.
Every font i tried gave me the same issue

I tried adding tr=” “ to the tag, simulating a space replacing itself, in order to circumvent the issue, but nothing.

Did anyone ever solve this problem?

Thamk you for your help

Offline

#164 2008-01-26 18:24:10

thame
Member
Registered: 2005-06-07
Posts: 96
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

I’m in the process of transitioning my site from a slightly modified ALA version to zem_ir. For layout purposes, I’m using the ‘img’ method, but would like to be able to feed the zem_ir tag word-by-word.

I’ve been split()-ing the <txp:title /> tag, but I was wondering if there were some better way to do it or if it could be abstracted into the plugin somehow (so that I don’t call zem_ir multiple times).

<txp:php>
$words = split(' ', $GLOBALS['thisarticle']['title']);
foreach ($words as $word) {
	echo zem_ir(
		array(
			'font'=>"gothamBoldCond.ttf",
			'transform'=>"uppercase",
			'method'=>"img",
			'fontsize'=>10
		),
		"$word"
	);
}
</txp:php>

Also, I’m having some issues with how the text is displayed. In this example page the text for the word “The” is a bit off in the image itself but is fixed when I add an extra letter. It appears to be related to zem_ir (and not the font) because the same text comes out ok in the ALA version.

It’s an awesome plugin, and is much faster than what I’m using now, thanks Zem!

Offline

#165 2008-02-02 11:36:50

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,681
GitHub Twitter

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Hi everybody.

I don’t know if it’s possible with ZIR?

I would like to apply Image Remplacement only for one specific span class attribute in my text.

Could you answer to me if it’s possible, and how get the rule?

Tks lot in advance,

Cheers,

Last edited by Pat64 (2008-02-02 16:01:37)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB