Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

PostSummary.ss, odd markup in post-image paragraph


Go to End


2 Posts   2310 Views

Avatar
javabrett

Community Member, 2 Posts

7 September 2015 at 11:56am

Edited: 07/09/2015 11:58am

Hi,

I'm using silverstripe-blog dev-master latest 4e78e58 on 3.1.13. I'm noticing some strange markup in the post-summary from PostSummary.ss [1]:

	<p class="post-image">
		<a href="$Link" <%t Blog.ReadMoreAbout "Read more about '{title}'..." title=$Title %>>
			$FeaturedImage.setWidth(795)
		</a>
	</p>

Firstly, I don't think I have a featured image assigned ... but this markup will render anyway - there's no conditional around it?

But the bigger problem is the Blog.ReadMoreAbout call output, which seems to be sitting inside the opening <a> tag, without an attribute name. This might be an overlap/confusion with the following Excerpt/Summary logic, which does similar things.

So my questions are:

  • Should that post-image block be rendering at all, if I haven't added a featured image for the post, does it need some conditional logic around it?
  • Should the Blog.ReadMoreAbout be removed from this block?

Thanks
Brett

[1] https://github.com/silverstripe/silverstripe-blog/blob/master/templates/Includes/PostSummary.ss

Avatar
javabrett

Community Member, 2 Posts

22 November 2016 at 5:52pm

Edited: 22/11/2016 5:53pm

The missing attribute name for

Blog.ReadMoreAbout
was fixed by https://github.com/silverstripe/silverstripe-blog/commit/bb1484b45e3bad27b10b47a8973da65c54245a68 by the addition of title=.