English word for ...

Robert9

Well-known member
A typical blog looks like this:

Start page
News1
short text, link to detailed page

News2
short text, link to detailed page

News
short text, link to detailed page



For the short text we normally have three ways:

snippet (counted part of the text)
preview (marked part of text)
i dont know} - own text only for index.

opener? lead?

I remember there was a special word.


You may understand my problem and can help?
 
Teaser would be also ok (in my language)
but there is a special word, when you write a text for a blog, and then choose a part from the beginning as your [...]
 
Yes, it makes me crazy also the whole day. It is a word I have learned some years ago using word press.
It is used for that part of the text, that we show on the index page. I have found a word, but it makes me crazy not to remember the other one.
 
Thank you very much.

Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. Excerpt. ...

Der Auszug = a part of the original text.

So it should be:

snippet = first {x} chars
excerpt = a part of the text (instead of preview or better use preview?)
and for a short new text, I use: opener? =English Translation for German "Aufmacher"?
Is the new text on the index page the opener? Or is opener a part of the final text?


a) text

b) snippet]text[/snippet
text

will cut after {x}

c) excerpt]text[/excerpt
text

will not cut text

d) opener]text a[/opener
text b

complete new text

That's all what we do, i guess.



Do people like short words above the title like

[REAL STORY]
The truth about old shoes in cold nights


or


[REAL STORY]

The truth about old shoes in cold nights


Better to add also. Has this [REAL STORY] an English name?
Make two of them with background colour and one with a line.


If you all could choose more tools to style a text, what would be your wishes, please?
 
And Now For Something Completely Different

My finder has some $posts for me in my c/p/class

Now I want to regex the $message to find
snippet, excerpt or opener

from [opener]text a[/opener]text b

the result i add to $params working with $posts to array, do my regex, add newArray to $params or to $post?

Can i extend $post with $post->preview = part of text?
Or only replace $post->message with part of text?

If i want to replace ->message i use a setter in entity/post?

in c/p/class i do

$posts = finder ...

foreach ($posts as $post)
$post = $post->setMessage()
or $post->message = $post-message->setMessage()


but anyway my c/p/class does not know setMessage()

do i need newFunction(/xf/entity/post $post)
$post->message->setMessage()

in controller?

and add setter and setMessage to entity/post?

i have many examples in controller > add/edit > preparer,
but here i dont have add/edit
 
Last edited:
Can i extend $post at all?
There is an example with $user->isAdmin?

Somewhere else i read that an entity is always the table only.
But there are examples using fields from other tables like to save field inputs.

I have to check the ->inline true/false in a minute.
 
Last edited:
c/p/new class
fetches some posts

posts like

$preview = preg_match from [excerpt*]text a[/excerpt] Text B
*exerpt|snippet|opener

pass preview to template

Way1
replace $post->message with $preview

add setter and setMessage() to entity/post
how to make controller knowing setMessage()?


Way 2 ?
Can i extend an object with new fields (without having them as mysql_table_fields?
Can I add $post->color, $post->headline, $post->important(true/false), but dont have xf_post.color ...


Way 3
From $posts i create $postsArray
then I work with this array, change values, then i pass it to $params for my template


Way 3 i can do;
Way 1 i try to realize, but fail with controller knowing the function setMessage()
Way 2 i would like to know, if i can do that


Example Way 3 - XFRM\ControllerPlugin\Overview
'resources' => $resources,
'canInlineMod' => $canInlineMod,


Way 2?

$structure->getters = [
'prefixes' => true,

prefixes is no field of xf_rm_category


so can I do

$post->lala_field = getLala

add getter lala to entity
add getLala() to entity


how to make controller knowing getLala?

to make a repository viewable we tell the controller: hey, there is a repository, there you can call functions!
but the entity is shown how? Maybe i just have to add "use entities"? Hmmm ... i go and search for ...
 
PHP:
class Post extends XFCP_Post
{
    public function getPreview()
    {
        $post = $this->post;

        $message = $post->message;

        if (preg_match("/\[opener\](.*)\[opener\]/", $message, $matches))
        {
            $post->message = $matches[1];
        }

        return $post;
    }


    public static function getStructure(Structure $structure)
    {
        $structure = parent::getStructure($structure);
        $structure->getters['Preview'] = true;
        return $structure;
    }
}

I thought that from now
$post should know everywhere getPreview?
 
Back
Top Bottom