get article content

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

get article content

pierrick.bena
Hi !

I have several Blog articles and I get their content with  
obj.getProperty('content').getValue().

I have two questions :

1) Is it possible to get exactly the right format of the content ? For
example, if  I have a bold or italic word , when I get the value I have
**bold word**   and  // italic word //  .
I would like to have the word directly in bold or italic.


2) If it's not possible, is there a way  to get the value of the
content without  specials caracters like   ** **  or // //   ?


Thanks for help !

Regards, Pierrick

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: get article content

Guillaume "Louis-Marie" Delhumeau
Hi.

Instead of using *obj.getProperty('content').getValue()* you should
use *obj.display('content',
'view')*, or *obj.display('content', 'edit')* if you want an edit form for
this field, or *obj.get('content') *if you want to display it on view mode,
and have a form on edit mode.

*obj.getProperty('content').getValue() *is designed to give you the
*real*content which is saved, it is not rendered.

Regards,

Louis-Marie

2013/7/22 <[hidden email]>

> Hi !
>
> I have several Blog articles and I get their content with
>  obj.getProperty('content').**getValue().
>
> I have two questions :
>
> 1) Is it possible to get exactly the right format of the content ? For
> example, if  I have a bold or italic word , when I get the value I have
> **bold word**   and  // italic word //  .
> I would like to have the word directly in bold or italic.
>
>
> 2) If it's not possible, is there a way  to get the value of the content
> without  specials caracters like   ** **  or // //   ?
>
>
> Thanks for help !
>
> Regards, Pierrick
>
> ______________________________**_________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/**mailman/listinfo/users<http://lists.xwiki.org/mailman/listinfo/users>
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: get article content

pierrick.bena
Thanks Louis-Marie, it works I have the good result but it's between
{{html clean="false" wiki="false"}}  and {{/html}}

Is it possible to not display this ?




On Mon, 22 Jul 2013 12:34:52 +0300, "Guillaume \"Louis-Marie\"
Delhumeau" <[hidden email]> wrote:

> Hi.
>
> Instead of using *obj.getProperty('content').getValue()* you should
> use *obj.display('content',
> 'view')*, or *obj.display('content', 'edit')* if you want an edit form for
> this field, or *obj.get('content') *if you want to display it on view mode,
> and have a form on edit mode.
>
> *obj.getProperty('content').getValue() *is designed to give you the
> *real*content which is saved, it is not rendered.
>
> Regards,
>
> Louis-Marie
>
> 2013/7/22 <[hidden email]>
>
>> Hi !
>>
>> I have several Blog articles and I get their content with
>>  obj.getProperty('content').**getValue().
>>
>> I have two questions :
>>
>> 1) Is it possible to get exactly the right format of the content ? For
>> example, if  I have a bold or italic word , when I get the value I have
>> **bold word**   and  // italic word //  .
>> I would like to have the word directly in bold or italic.
>>
>>
>> 2) If it's not possible, is there a way  to get the value of the content
>> without  specials caracters like   ** **  or // //   ?
>>
>>
>> Thanks for help !
>>
>> Regards, Pierrick
>>
>> ______________________________**_________________
>> users mailing list
>> [hidden email]
>> http://lists.xwiki.org/**mailman/listinfo/users<http://lists.xwiki.org/mailman/listinfo/users>
>>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: get article content

Guillaume "Louis-Marie" Delhumeau
I usualy replace the "{{html}}" thing with the String#replaceAll() method :)

2013/7/22 <[hidden email]>

> Thanks Louis-Marie, it works I have the good result but it's between
> {{html clean="false" wiki="false"}}  and {{/html}}
>
> Is it possible to not display this ?
>
>
>
>
> On Mon, 22 Jul 2013 12:34:52 +0300, "Guillaume \"Louis-Marie\"
> Delhumeau" <[hidden email]> wrote:
> > Hi.
> >
> > Instead of using *obj.getProperty('content').getValue()* you should
> > use *obj.display('content',
> > 'view')*, or *obj.display('content', 'edit')* if you want an edit form
> for
> > this field, or *obj.get('content') *if you want to display it on view
> mode,
> > and have a form on edit mode.
> >
> > *obj.getProperty('content').getValue() *is designed to give you the
> > *real*content which is saved, it is not rendered.
> >
> > Regards,
> >
> > Louis-Marie
> >
> > 2013/7/22 <[hidden email]>
> >
> >> Hi !
> >>
> >> I have several Blog articles and I get their content with
> >>  obj.getProperty('content').**getValue().
> >>
> >> I have two questions :
> >>
> >> 1) Is it possible to get exactly the right format of the content ? For
> >> example, if  I have a bold or italic word , when I get the value I have
> >> **bold word**   and  // italic word //  .
> >> I would like to have the word directly in bold or italic.
> >>
> >>
> >> 2) If it's not possible, is there a way  to get the value of the content
> >> without  specials caracters like   ** **  or // //   ?
> >>
> >>
> >> Thanks for help !
> >>
> >> Regards, Pierrick
> >>
> >> ______________________________**_________________
> >> users mailing list
> >> [hidden email]
> >> http://lists.xwiki.org/**mailman/listinfo/users<
> http://lists.xwiki.org/mailman/listinfo/users>
> >>
> > _______________________________________________
> > users mailing list
> > [hidden email]
> > http://lists.xwiki.org/mailman/listinfo/users
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users