aText slot - Text wrapped in <p> - Why?

25 views
Skip to first unread message

luk4s

unread,
Jul 5, 2010, 4:07:09 PM7/5/10
to apostrophenow
G'night everyone

I put something like this in my template:

<h2><?php a_slot('headline', 'aText'); ?></h2>


Why does it end up as
<h2><p>the text i entered via editing</p></h2>

And the <p> tag is written to the database. An empty edit field? Ends
up as <p></p>.


How do I make aText be *real* plaintext?


As a workaround for now I tried this:
<h2><?php a_slot('headline', 'aText', array('allowed-tags' =>
'<pre>')) ?></h2>

to have <p> removed.

Didn't work.

Versions:
symfony -- via svn external from http://svn.symfony-project.com/branches/1.4
apostrophePlugin - branches/1.4 as well.


Thanks,
-Lukas

Tom Boutell

unread,
Jul 5, 2010, 6:07:02 PM7/5/10
to apostr...@googlegroups.com
The simple_format_text helper does that. I think it would make sense
for us to add options to strip it down and turn off things like
links-to-URLs and line breaks to paragraphs, especially when you're
not using the multiline option. A true plaintext slot ought to be
available. I suggest that you open a ticket on trac.apostrophenow.org.

--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

luk4s

unread,
Jul 6, 2010, 12:05:20 AM7/6/10
to apostrophenow
Yes, that would be nice. Ticket here:
http://trac.apostrophenow.org/ticket/471

...I really only need plain text - inside of an <hX> - so that it will
be Cufon'ed as a headline easily
as prepared in my layouts.

How-To-Question:
How to get the raw value of a slot rendered without
the _area -> _slot -> yadda yadda wrappings?

In components.class.php I could "see" my almost-plain text as
$value["text"]

For the record: I also tried to simply create my own "justPlaintext"
type, but, oh
well: this is the <h2>....</h2> markup I ended up with.

<h2><div id="a-area-7-headline" class="a-area a-area-
headline">
<div id="a-slots-7-headline" class="a-slots">
<div class="a-slot justPlaintext " id="a-slot-7-headline-2">
<div class="a-slot-content" id="a-slot-content-7-headline-2">
----



This is a Plain TExt Slot!----
</div>
</div>
</div> </div> <!-- END SLOT -->
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
});
</script></h2>


Thanks,
-Lukas

On 6 Jul., 00:07, Tom Boutell <t...@punkave.com> wrote:
> The simple_format_text helper does that. I think it would make sense
> for us to add options to strip it down and turn off things like
> links-to-URLs and line breaks to paragraphs, especially when you're
> not using the multiline option. A true plaintext slot ought to be
> available. I suggest that you open a ticket on trac.apostrophenow.org.
>
>
>
> On Mon, Jul 5, 2010 at 4:07 PM, luk4s <lukas.schroe...@code-mitte.de> wrote:
> > G'night everyone
>
> > I put something like this in my template:
>
> > <h2><?php a_slot('headline', 'aText'); ?></h2>
>
> > Why does it end up as
> > <h2><p>the text i entered via editing</p></h2>
>
> > And the <p> tag is written to the database. An empty edit field? Ends
> > up as <p></p>.
>
> > How do I make aText be *real* plaintext?
>
> > As a workaround for now I tried this:
> > <h2><?php a_slot('headline', 'aText', array('allowed-tags' =>
> > '<pre>')) ?></h2>
>
> > to have <p> removed.
>
> > Didn't work.
>
> > Versions:
> > symfony -- via svn external fromhttp://svn.symfony-project.com/branches/1.4

Pete Sisson

unread,
Jul 7, 2010, 9:45:20 AM7/7/10
to apostrophenow
Hey Tom

Could we set some kind of public target, so that if we get, say, 100
of these 'what on earth is all this markup and why on earth do we need
it' threads, then it will get changed? :))

It would just be helpful to know how much more pressure we need to
apply :)

Pete

Alex Gilbert

unread,
Jul 7, 2010, 9:52:00 AM7/7/10
to apostr...@googlegroups.com
Ha! I like it.
--
Alex Gilbert
P'unk Avenue
215-755-1330
al...@punkave.com

Daniel Lohse

unread,
Jul 7, 2010, 10:51:40 AM7/7/10
to apostr...@googlegroups.com
Count me in for the public demonstration on the streets in front of P'unk Ave's offices... :P


Cheers, Daniel

Geoff DiMasi

unread,
Jul 7, 2010, 10:55:32 AM7/7/10
to apostr...@googlegroups.com
That would be very cool.

If you need a room to stay at when you come down for the demonstration, let me know. We can put you up.


--
Geoff DiMasi

P'unk Avenue
215 755 1330

Pete Sisson

unread,
Jul 7, 2010, 11:24:47 AM7/7/10
to apostrophenow
Hehe

A stateside protest would be a bit expensive for any of us Euro's but
I'd settle for a totaliser ( http://www.bbc.co.uk/cbbc/bluepeter/img/c/getinvolved/appeal/totaliser4.png
) on the front page of the googlegroup to keep track of how far away
we are from the target.



On Jul 7, 3:55 pm, Geoff DiMasi <ge...@punkave.com> wrote:
> That would be very cool.
>
> If you need a room to stay at when you come down for the demonstration, let me know. We can put you up.
>
> --
> Geoff DiMasi
> P'unk Avenue
> 215 755 1330http://punkave.com
>
> On Jul 7, 2010, at Jul 7,10:51 AM, Daniel Lohse wrote:
>
> > Count me in for the public demonstration on the streets in front of P'unk Ave's offices... :P
>
> > Cheers, Daniel
>
> > On 07.07.2010, at 15:52, Alex Gilbert wrote:
>
> >> Ha! I like it.
>
> >> a...@punkave.com

luk4s

unread,
Jul 9, 2010, 7:35:48 AM7/9/10
to apostrophenow
I'll start a CMS contest in the next days:

Steps necessary to get your really cool CMS to output really plain
text.

How much code is necessary to make your CMS output just plain text

to start:
years ago i wrote my own cms. you need two template:
page template and block template.

the pagetemplate would say:
{lukks_container name="content"}

the blocktemplate would say:
{lukks_text name="text1"}


e voila. the rendered page would contain no markup at all. no byte
even as long as text1
was an empty slot ;-)



On 7 Jul., 17:24, Pete Sisson <petes...@gmail.com> wrote:
> Hehe
>
> A stateside protest would be a bit expensive for any of us Euro's but
> I'd settle for a totaliser (http://www.bbc.co.uk/cbbc/bluepeter/img/c/getinvolved/appeal/totalise...

Tom Boutell

unread,
Jul 9, 2010, 8:16:27 AM7/9/10
to apostr...@googlegroups.com
One quick way to do this with Apostrophe is to override the
_normalView.php template of the aText module at the project level and
call strip_tags there (leave the entities alone, just strip the tags).

Another approach is to use apostrophe:generate-slot-type and make a
new slot in which you can do exactly as you please.

Abraham Block

unread,
Jul 9, 2010, 8:19:13 AM7/9/10
to apostr...@googlegroups.com
Or you wind up just hardcoding the stinkin' text in the template because 90% of the time, the client not only doesn't change it, but asks you to change it.

Alex Gilbert

unread,
Jul 9, 2010, 9:49:38 AM7/9/10
to apostr...@googlegroups.com
Good suggestions, Tom. Overriding aText/_normalView.php with strip_tags is dead easy and could probably the stock response for this one until there is a more elegant solution out of the box.
al...@punkave.com
Reply all
Reply to author
Forward
0 new messages