ElkArte Community

Elk Development => Theme development => Topic started by: Spuds on January 20, 2023, 06:00:02 pm

Title: How to add the 1.1.9 Quick Quote Function to your theme
Post by: Spuds on January 20, 2023, 06:00:02 pm
If you are running a custom theme, there is a good chance that the 1.1.9 patch will not be able to update your theme files.  The theme will still work w/o the updates, it will just lack the new functionality.  Below is how you would make the edits to add quick quote.

The quick quote function is where you highlight a section of another post and are presented with a quick quote button.  This allows you to selectively quote just a portion of another post in your reply.

How to add

In display.template.php find the div/section that holds the post body, it will look like:
Code: [Select]
		// Show the post itself, finally!
echo '
<section id="msg_', $message['id'], '" class="messageContent', $ignoring ? ' hide"' : '"', '>',

$message['body'], '
</section>';
You need to add two things. 
Code: [Select]
		// Show the post itself, finally!
echo '
<section id="msg_', $message['id'], '" data-msgid="',$message['id'], '" class="messageContent', $ignoring ? ' hide"' : '"', '>',
$message['body'], '
</section>';

// This is the floating Quick Quote button.
echo '
<button id="button_float_qq_', $message['id'], '" type="submit" role="button" style="display: none" class="quick_quote_button hide">', !empty($txt['quick_quote']) ? $txt['quick_quote'] : $txt['quote'], '</button>';

IMPORTANT The button positing is absolute from the top of the page.  If your theme sets a position: relative on a parent container of the button, then the position will be wrong (it will be absolute from the parent container that is relative).  In this case it will position too far down the page, possibly even off screen.  Things you can try:


.