i'm desiring to move the placement of the main view of the addthis link sharing plugin to a new position in my site and i see that in the start.php file for the addthis plugin there is the line:
elgg_extend_view('object/elements/summary', 'addthis_share/addthis');
so i replaced 'object/elements/summary' with various other locations, such as 'page/elements/comments'.. yet the addthis box does not render in the new location (it does cease to be rendered in the original location.
i noticed when reading through other discussions on the subject of extending views that one piece of advice was to run upgrade.php, yet that too effects no change.
i'm out of ideas.. has anyone encountered a similar issue? any resolution?
thanks
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- ura soul@tunist
ura soul - 0 likes
- ura soul@tunist
ura soul - 0 likes
- ura soul@tunist
ura soul - 0 likes
- ura soul@tunist
ura soul - 0 likes
- iionly@iionly
iionly - 0 likes
- ura soul@tunist
ura soul - 0 likes
You must log in to post replies.have you looked at the addthis_share/addthis view? Maybe it depends on some $vars that don't exist in the other views - like $vars['item'] for instance.
thanks, this is the code for that view:
<?php
$float = elgg_get_plugin_setting('alignposition', 'addthis_share');
$button = elgg_get_plugin_setting('buttonstyle', 'addthis_share');
$pubid = elgg_get_plugin_setting('profileID','addthis_share');
$full = elgg_extract('full_view', $vars, FALSE);
$context = elgg_get_context();
if ($full && $context != 'thewire' && $pubid != '' ) {
// echo '<div style="float:'.$float.'">';
echo '<div class="share-box">';
switch ($button)
{
case 'big': ?>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=<?php echo $pubid; ?>"></script>
<!-- AddThis Button END -->
<?php break;
case 'small' : ?>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=<?php echo $pubid; ?>"></script>
<!-- AddThis Button END -->
<?php break;
default: ?>
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=<?php echo $pubid; ?>"></script>
<!-- AddThis Button END -->
<?php
echo '</div>'; } ?>
<?php } ?>
.....
i think $full is the only one there that might be an issue, yet i see it is replaced with the default constant 'FALSE' if not present (if my comprehension of PHP is accurate).
though you just prompted me to look through the logs. which i hadn't done as they were massive last time i looked!
nothing relevant in the error log
double post
There is a check if 'full_view' is defined in the view. If the check does not return anything $full is set to false additionally. But with the following if-clause the addthis content is only added of $full is true. So, if the view you want to extent isn't a full view there won't get added anything, i.e. the view is extended with "nothing".
If you want something to show up on views that are no full views, you need to add and else-part to the if-clause and define what content to show up then. If it works on others than full views is something you need to test out though.
aha! i missed that, yes.. i've moved the element now.. thanks so much. :)