Forums / General / Another 'Read more' question

Another 'Read more' question

Author Message

Steven Stieng

Friday 28 May 2010 3:48:39 am

Ok, so I've created a 'red more' link. No problem. But I need to limit the number of words from the intro text.

E.g. I only want to display the first 15 words followed by '...' and then 'Read more'.

Are there any functions in eZ for this?

If not, I'm thinking of creating a function which reads the string (intro text), explodes it, and output the first 15  words.

I've already created such a function in PHP for a Wordpress template. But how would I go about doing the same using the eZ "language"?

Steven E. Bailey

Friday 28 May 2010 4:35:43 am

Take a look at http://projects.ez.no/smartshort/ - see if it fits your needs.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Steven Stieng

Friday 28 May 2010 4:41:25 am

That looks something that I could use.
Where do I download the template? I can't see any links on the page. 

André R.

Friday 28 May 2010 8:46:22 am

"Download" tab, then install as any other extension (and activate it and so on), see doc: http://ez.no/doc/ez_publish/technical_manual/4_x/installation/extensions

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Steven Stieng

Friday 28 May 2010 9:38:15 am

There is no Download tab.
I'm using Opera and I'm logged in.

All I can see on the right side is: Track changes, Latest News, Lates reviews and Lates forum activity.

In the main area there's just the template datatable (UNIX name, Owner etc) and the text body.

Steven E. Bailey

Friday 28 May 2010 1:49:46 pm

Try this link:

http://projects.ez.no/content/download/22958/96301/version/1/file/smartshort-1.0.zip

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

eZ debug

Timing: Jan 18 2025 14:57:26
Script start
Timing: Jan 18 2025 14:57:26
Module start 'content'
Timing: Jan 18 2025 14:57:26
Module end 'content'
Timing: Jan 18 2025 14:57:27
Script end

Main resources:

Total runtime0.2885 sec
Peak memory usage4,096.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 587.7031180.8438
Module start 'content' 0.00700.0067 768.546997.9297
Module end 'content' 0.01380.2747 866.4766526.1484
Script end 0.2885  1,392.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00381.3291200.0002
Check MTime0.00150.5323200.0001
Mysql Total
Database connection0.00070.249610.0007
Mysqli_queries0.231480.20761410.0016
Looping result0.00180.62061390.0000
Template Total0.274295.010.2742
Template load0.00100.342410.0010
Template processing0.273294.699010.2732
Override
Cache load0.00070.248210.0007
Sytem overhead
Fetch class attribute can translate value0.00130.453310.0013
XML
Image XML parsing0.00040.145810.0004
General
dbfile0.00742.5489200.0004
String conversion0.00000.014530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs