1493 posts
|
The typical way to get a “teaser” followed by a “Read more…” link to the full article is to use the ‘extended’ page part. A few things have got me thinking about other ways of doing this:
- using another CMS, I could just put
[more] in the post, and that’s all it took to generate the teaser+link (it was Flatpress if you must know!)
- Andy’s get leading sentences technique got Martijn thinking about whether it could also be used for a more “elegant” “Read more…”, and that was further inspiration; and
- defunct’s multilanguage solution using page-parts was another trigger, since on the face of it, that solution would prevent you from using the standard method (using an “extended” page-part).
So! Here’s what I came up with:
1. In your article (blog entry, whatever), you simply put in this “trigger”:
<!-- more -->
where you want the break to occur. (The code below assumes this will come mid-paragraph, but that can easily be adjusted.) Write the WHOLE article simply in the default “body” page-part.
2. On your homepage (if you display recent articles there), or especially in the “Articles” page (where your blog entries, news items, etc., are listed), replace this code:
<?php echo $article->content(); ?>
<?php if ($article->hasContent('extended')) echo $article->link('Continue Reading…'); ?>
with this code:
<?php if (strpos($article->content(), '<!-- more -->') === false ) {
// no "more" trigger, then echo content
echo $article->content();
} else {
// is a "more" trigger, so echo teaser and add link to whole article
echo substr($article->content(), 0, strpos($article->content(), '<!-- more -->'));
echo '</p><p><a href="'. $article->url() .'">Read more...</a></p>';
} ?>
And hey presto! All finished. Everything before <!-- more --> is used as teaser, and when the whole article is viewed, it is of course “invisible”.
It even validates, and it works with both Textile and Markdown filters. I don’t know what TinyMCE would do with it, however. (Note that the </p><p> in the last line of the code is where the assumption comes in that your “more” trigger is mid-paragraph.)
There may be things I’m missing (probably are!), and if you spot ways of improving this technique, do add them in as comments here. |
| |
41 posts
|
Great suggestion, David! Thanks for the tip. I think I even like more this approach than using page parts, as all my main content is edited on one page, so I can leave the page parts for other fields. |
| |
541 posts
|
really lke this idea David :)
little optimisation here ;)
<?php if (($more_pos = strpos($article->content(), '<!-- more -->')) === false ) {
// no "more" trigger, then echo content
echo $article->content();
} else {
// is a "more" trigger, so echo teaser and add link to whole article
echo substr($article->content(), 0, $more_pos);
echo '</p><p>'. $article->link('Read more...') .'</p>';
} ?>
|
| |
1493 posts
|
little optimisation here ;)
Nice! Thanks, Philippe! |
| |
96 posts
|
And if we only had the wiki that was promised, tips like this wouldn’t get lost in the forum…. |
| |
76 posts
|
Nice. Very subtle ;) |
| |
1493 posts
|
Off topic, but:
And if we only had the wiki that was promised, . . .
I have reason to believe that you won’t have to wait too much longer! ;) |
| |
541 posts
|
humm what you mean David … I don’t understand :P |
| |
96 posts
|
Nice. Very sutble ;)
That’s my name – Mr Subtle, first name Brick. ;) |
| |
40 posts
|
+1 for wiki :D |
| |
184 posts
|
I like this idea. Has anyone got a similar method working for normal pages too? |
| |
21 posts
|
@David – I use TinyMCE. What I got to work was to use the pagebreak plugin along with a slight change to the code above.
<?php if (($more_pos = strpos($article->content(), '<!-- more -->')) === false ) {
changed to
<?php if (($more_pos = strpos($article->content(), '<!-- pagebreak -->')) === false ) {
|
| |
4 posts
|
Great post, thanks a lot!
Works like a charm and a nice code for the markup |
| |
22 posts
|
+1 like this idea |
| |
19 posts
|
excited about the wiki. |
| |
12 posts
|
This is great. Just what I needed, thanks! |
| |
184 posts
|
Hey Dr Hankes,
We use TinyMCE alot and I myself was wondering what would be the best way to do this … I think I will adopt your idea, perhaps with a custom button icon, as the pagebreak is not something our users would need per say. |
| |
6 posts
|
What about this?
<?php
echo substr(strip_tags($article->content()),0,500);
echo $article->link('Read more...');
?>
|
| |
35 posts
|
Be careful with strip_tags. I have found that it leaves spaces where the tags were, sometimes. For example if i your code you have an image then some text
<img src="Image.jpg" />Some text
when you strip the tags, it wil put a space in front of “ Some text”. You might want to trim it as well
<?php
echo substr( trim( strip_tags( $article->content() ) ) , 0, 500 );
echo $article->link('Read more...');
?>
|
| |
6 posts
|
Thanks avagraphique. That’s a good point and you’re correct. |
| |
130 posts
|
Solution to Convert MKV to AVI FORMAT Mac?
Have you wondered how to convert MKV movies that downloaded online to AVI FORMAT formats for much free enjoyment? Here I am very glad to share this guide with guys who would like to convert MKV to AVI format on Mac pc. This guide can have in detailed ways and it is very easy to understand.
MKV file format is an envelope for which there can hold many sound files, video and subtitles in one single file. It comes with large size contrast to AVI, MP4 or some other widely-used video formats. Moreover, MKV format is not supported by many gadgets and media players. That’s why people always convert MKV to other formats usually.
Steps about how to [url=http://www.mkvconvertersoft.com/how-to-convert-mkv-to-avi-mac/]convert MKV to AVI Mac[/url]:
Download Mac MKV Converter first.
STEP 1 Add Videos
Click “Add” icon to load original source files.
STEP 2 Output Settings
Select each file and judge the output format in “Profile”. Select a target format for the output according to your requirement. Here we choose AVI FORMAT as output format.

Click “Settings” button to set audio and video general parameters.

To save your time to set multiple files one by one, you may click “Apply to all”.
STEP 3 Video Editing
Hit “Edit” icon to open the video editing window as below.
Five options are offered: Trim, Crop, Rotation, Effect and Watermark.
STEP 4 Done
After all the settings, hit button to start MKV to AVI FORMAT Mac conversion.
With professional MKV to AVI Mac converter, you will find it is easy to convert MKV to AVI. |
| |
130 posts
|
How you can save YouTube video as MP4 file?
YouTube videos may be straight watched just when you browsing internet with a portable device or a pc. Nevertheless, sometimes, for instance, when we take a visit, we’ve to observe the YouTube videos on our devices or computers offline, we must obtain and convert YouTube videos to a compatible video format like MP4. YouTube. com hasn’t provided converters for us to convert the YouTube videos. Hence, we need make use of a third-party program that might convert YouTube video to MP4.
Here, to convert YouTube video to MP4, we will use this video converter which will allow us to achieve the goal also as give us some additional editing characteristics like Trim, crop, effects and watermark for better output video effects. Now, adhere to me to get started on converting YouTube video to MP4.
Step 1: Load the YouTube video
Set up and launch the video converter. Just click “add” icon to input the YouTube video. Double click on the video file or maybe click on the play button beneath the view screen for previewing. Batch transformation is supplied here.
Step 2: Set output
Just click “Profile” and you will see a drop-up box where you’ll select MP4 from the common video tab or maybe straight search MP4 in the searching bar. At the same time, select a folder as output folder in “Output”.

Step 3: edit the movie
If you have some basic editing demands, this step will assist you. Click on the edit icon and you’ll see FOUR editing characteristics: Trim, Crop, Effects and Watermark.

Trim – trim the video clip that you need through setting the start time and end time.
Crop – Crop the video size through straight dragging or maybe input the size.
Effects – change brightness, saturation and contrast, volume.
Watermark – add text or maybe image watermark by your own.
Step 4: converting YouTube video to MP4
After all of the above settings, it’s time for you to convert YouTube video to MP4. Push the convert icon to start out the YouTube video to MP4 conversion.
After the transformation, get pleasure from your movie and enjoy your trip. |
| |
130 posts
|
The way to Convert MKV to Bluray?
Blu-ray will be the most advanced technology to keep info. Info displays an individual level Blu-ray dvd can retailer about half a dozen times a lot more info in comparison to common DVD disc. Blu-ray was started out simply by The, the file format picked simply by every one of the key motion picture companies. When you have several variety of motion pictures, video clips readily available, they may be area busy. If you want to the hard drive upwards and also retailer these desired videos, make an effort to duplicate on Blu-ray dvd, then you can certainly take pleasure in your entire choices about fresh Blu-ray players.
With specialist Blu-ray creator, help make Blu-ray dvd all on your own isn’t a headache. Leawo Blu ray creator is mainly made for Blu-ray and also DIGITAL VIDEO DISC creating. That permits consumer burning almost all different multimedia system videos on dvd. In addition, it gives potent movie manager allowing consumer to be able to reduce it size, plants it dimensions, change movie result and also increase watermark to be able to video clips. 3 DIMENSIONAL options are permitted also.
The following is in depth measures about how precisely to be able to convert MKV to Bluray.
1. Go through the “Add” option to be able to importance video clips for the system, accessible to survey movie pleased with built-in player.
2. Change options data files if needed. Reduce movie dimensions simply by feedback commence serious amounts of conclusion moment. Plants out there needless parts about framework. Or perhaps change shade result and also increase watermark about framework.
3. Struck the particular burn off option, check out pick food selection web templates regarding end result Blu-ray dvds. To your desire, you could modify your own personal type, qualifications image/ video/ audio.
4. Previous stage is always to established superior options regarding end result, just like dvd type, bit rate, TV Standard? – Advise to decide on BD-50 regarding dvd type. Pick NTSC TV standard in case you are inside America. Pick High Video Quality inside Bit rate.
All things considered options are usually prepare yourself, select Learn to burn off MKV to Bluray. |
| |
130 posts
|
Guide regarding Ripping Blu ray Videos on Mac Laptop together with Blu ray Ripper for Mac
How should we creator electronic digital copies of one’s desired Blu-ray motion pictures about Mac pc personal computer? We could very easily reach that goal with specialist Blu ray ripper for Mac. This type of pulling instrument contains its very own pair of decryption equipment that may very easily eliminate the Blu-ray dvd defense and also change articles directly into some other movie types regarding satisfaction.
Information: The way to grab Blu ray on Mac pc
Help make products:
a single. Blu ray Ripper for Mac pc
a couple of. Mac pc Operating-system pc together with Blu ray drive
several. Blu ray dvd
Step1. Importance Blu ray to Blu ray Ripper
Lug and also fall or perhaps simply click Weight BD option around the food selection pub to be able to importance Blu ray resource to be able to Blu ray Ripper. You can even importance Digital video disc or perhaps Blu ray/DVD directory.
Step2. Established end result file format
Go through the clickable symbol in the long run of each and every BD record to penetrate Account cell. Leawo Blu ray Ripper provides offered different end result file format and also gadgets so that you can pick from. You can even lookup the necessary file format or perhaps system inside the lookup pub.

Step3. Options
To fulfill the system a lot more specifically, it is possible to simply click “+” option setting the particular parameter regarding end result car stereo, including car stereo codec, top quality, tad fee, framework fee, and so forth.
Step4. Split Blu ray
Come back to your home software and then click “Convert” option to start out to rip Blu ray It is possible to established after-done options regarding crisis.
Suggestions:
Change Blu ray data files
This kind of Blu ray Ripper has produced inside movie manager regarding consumers to be able to change Blu ray data files to raised result. And also under I am going to present produce a details concerning the built-in manager.
a single. Trim-you can easily lug the particular limiters around the person development pub or perhaps go through the limiter option under or perhaps feedback nanosecond time to adjust the gap.
a couple of. Crop-get gone african american ends and also plants it inside clipped dimensions.
several. Rotation-Click turn to be able to move movie to get a special perspective see. Diverse sides are given one to move.
several. Change movie effect-Go to be able to Result loss and also change movie result, which includes Settings, Distinction, Vividness and also Amount
a few. Increase watermark-You may add graphic or perhaps text message watermark in your Blu-ray/DVD data files being a unique regarding really nice revealing and also play. You can even carry out options in your unique. |
| |
130 posts
|
Transform MKV to DVD: Simple to Make Your Own DISC
Do you have plenty of precise videos with regards to party, home vacation and other memorial records? Perhaps you are searching for a method to do convert high quality MKV video to DVD disc for easily storage. Then, this post may be be able to offer you an option. Convert MKV to DVD actually is quite easy if you choose the right tool. Want to convert MKV to DVD, you should to utilize DVD creator not a video converter. Professional DVD creator can rip videos to DVD discs with original high quality.
When you have DVD Creator, stick with below steps to convert MKV to DVD:
1. Click on “Add” to import first MKV videos or specifically drag-and-drop them in to DVD creator or click “File”.
2. Click Edit icon to edit the video before burning.
Go to “Effect” to enhance video and audio detail by adjusting brightness, contrast and audio volumes.
Go to “Trim” to get an extract length of video you want to put into the DVD.
Go to “Crop” to get rid of black margins if there is any.
Apply a text to be a watermark above the video

3. Click convert icon head to next steps, select a DVD menu templates. It is available to customize background music and pictures.

4. When you finish menu choose, click on “Next” to make further DVD burning settings. You can choose to burn to DVD drive (insert a DVD disc first ), burn to ISO file or burn to DVD folder. You can also specify the output path for the ISO file or DVD folder, choose TV Standard (NTSC or PAL), Aspect Ratio, etc for the output. Besides, the software will estimate result file volume for you. Click “Start” and the whole DVD burning progress get started.

The burning status will be clearly shown in the progress bar. After the whole burning process, you can get the output file and start to enjoy your favorite videos on a DVD player. |
| |