(Note that a not-so-complex solution could be to first render blog post
content in plain text, and cut the result to display a summary...)
2014-10-06 18:18 GMT+02:00 Jeremie BOUSQUET <jeremie.bousquet(a)gmail.com>om>:
Hi,
Problem is if blog content contains more than plain text (ie, html macros,
groovy macros, multiple columns, etc ...), cutting 5 first lines may
generate content impossible to render. Also, nothing says that cutting 5
lines would generate 5 lines in rendered text.
I had the same issue but in my case the "cut" content was pure HTML, and
was displayed in the scope of an iframe, so at least it would not break the
rest of the page or generate exceptions. But it's a heavy solution for
blogs IMHO.
I suppose there are multiple ways to cut a part of this content in a clean
and generic way, but it doesn't seem very easy.
That being said, I suppose your code works most of the times if your blog
posts are mainly plain text or limited to very basic wiki syntax.
BR,
Jeremie
2014-10-06 17:37 GMT+02:00 Pascal BASTIEN <pbasnews-xwiki(a)yahoo.fr>fr>:
I cut at end of line (and remove empty line)
I replaced your piece of comment "#* Disabled until the content can be
cleanly cut." in #macro(getEntryContent of Blog.BlogCode doc
by this one
#if($onlyExtract)
#set($result = '')
#set($resultArray =
$entryObj.getProperty('content').value.split('\s*\n\s*',10))
#foreach ($value in $resultArray)
#if( $velocityCount > 5 )
#break
#end
#set($result = "$result
$value")
#end
#set($result = "${result}
[[...>>${entryDoc}||title='$services.localization.render('xe.blog.code.readpost')']]")
#end
________________________________
De : "vincent(a)massol.net" <vincent(a)massol.net>
À : XWiki Users <users(a)xwiki.org>
Envoyé le : Lundi 6 octobre 2014 17h16
Objet : Re: [xwiki-users] 2 lists = 3 differents sorts on xwiki 6.2.1 and
improve blog
On 6 Oct 2014 at 16:40:26, Pascal BASTIEN (pbasnews-xwiki(a)yahoo.fr
(mailto:pbasnews-xwiki@yahoo.fr)) wrote:
Hello,
On my space Webhome I have 2 lists with the same sort (modification
date):
{{spaceindex space="$doc.space" sort="modificationDate"/}}
and
{{activity spaces="$!aSpace" rss=true /}}
I edited one doc with minorEdit and I obtain 3 differents sort.
I can understand why spaceindex sort is different than "activity
spaces"
but why "activity spaces" sort is different than Main.WebRss?)
Here some screenshots:
http://snag.gy/l6iQt.jpg
http://snag.gy/JwMVu.jpg
NB: I modified BlocCode to display 5 first lines of content blog post
on
Blog.WebHome if the blog post have an empty summary, do you interested?
We used to have this and removed it since it causes too many problems.
How can you ensure you’re cutting at some place that doesn’t cause a
problem when rendered?
Thanks
-Vincent
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users