MiniFrontpage readmore make external

I just want to ask if how to link the readmore to external link? any possible way to do it?

For example I want to link readmore button to an external link. Any possible hack to do this? I believed this is very useful if you're going to display both internal post and external.

Thank you!
11 years 4 months ago #1 by John Tower

Please Log in or Create an account to join the conversation.

Hi John, unfortunately this is not possible at the moment as the readmore link is generated automatically from the article
11 years 4 months ago #2 by andy

Please Log in or Create an account to join the conversation.

Thank you so much for your quick reply.

I'm thinking if you could help me with this simple solution in my mind.

In article view edit mode (backend) I'm planning to add the external link in EXTERNAL REFERENCE field and make a condition whether to display the READ MORE BUTTON(default link) or READ MORE BUTTON(w/ external link).

Something like this: "xref is the value of External Reference"
$xref = $metadataParams->get('xreference');
 
<a href="<?php echo $xref; ?>" target="_blank" title="<?php echo $atitle ?>">
<?php else : ?>
<a href="<?php echo $link; ?>" title="<?php echo $atitle ?>" class="item-link">
<?php endif; ?>
11 years 4 months ago #3 by John Tower

Please Log in or Create an account to join the conversation.

Hi John, Please try this following workaround :
1. Open the mod_minifrontpage.xml, add this line anywhere you want
<field name="xlink" type="text" default="" label="External Link" description="External Link Desc"></field>
2. Open mod_minifrontpage.php, add this line arround line 90 :
$xlink = $params->get( 'xlink', '' );
3. Find this code in all files under the folder /mod_minifrontpage_tableless/themes :
<a class="mfp-readon" href="'.$item->link.'">'.$fulllink.'</a>
replace with :
<a class="mfp-readon" href="'.$xlink.'">'.$fulllink.'</a>
11 years 4 months ago #4 by andy

Please Log in or Create an account to join the conversation.

Here's the attached file. Meta data External Reference field.
$xref = $metadataParams->get('xreference');
<?php if (!empty($xref)): ?>
<a href="<?php echo $xref; ?>" target="_blank" title="<?php echo $atitle ?>">
<?php else : ?>
<a href="<?php echo $link; ?>" title="<?php echo $atitle ?>" class="item-link">
<?php endif; ?>
11 years 4 months ago #5 by John Tower

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum