Edit teaser text



  • I've modified topics_list to display the teaser under the title. However, i would like to further edit the teaser. I'm wondering about the best approach to do something like this. I'm thinking


  • Global Moderator

    What kind of changes do you want to do?



  • There's two things i want to do.

    1. Shorten the teaser text
    2. Pull out a specific link to use as a button

    I think i figured it out though using something like { "hook": "filter:topics.get", "method": "teaserContentShort" }

    var Theme = {
    	teaserContentShort: function (data, callback) {
    		data.topics.forEach(topic => {
    			topic.teaser.contentShort = topic.teaser.content.slice(0,20);
    		});
    
    		callback(null, data);
    	}
    };
    

    It seems to work. Hopefully thats not using the wrong paradigm.


Log in to reply
 

Suggested Topics

| |