Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • seaneo Friend
    #181185

    Hello,

    How can I make an article preview link directly to an external URL?
    So instead of opening the article, it just goes to a new window of an external URL?

    Example:
    at http://173.254.15.37/next/, when a user clicks on “Where to sleep”, and then see’s the Xumec Hotel, when the user clicks on the Xumec hotel, that the user be transported, in a new window, to http://www.mendozaeventos.com/lugar/976/1/xumec-apart-hotel#.UG2Hk-TLT0Q

    Thank you!

    arucardx Friend
    #469185

    This required quite abit of core hacking and the addition of a field in the backend for easy management. But it seems you are in luck because Joomla JED has plugin that looks like they can do the job just fine.

    Simple Redirect Plugin
    http://extensions.joomla.org/extensions/site-management/url-redirection/12651

    I don’t know if this works with K2 articles or not since I don’t use the plugin but it should work fine with Joomla articles.

    seaneo Friend
    #469242

    many thanks! cheers

    seaneo Friend
    #469551

    Hello, Nikita at Simpe Redirect tried her hardest but her plugin could not handle this.

    I thought this would be a very easy process…here is what I need to happen:

    1) User is at http://173.254.15.37/next/
    2) User clicks the menu item on the left side of the screen “Where to sleep”
    3) User now see this: http://173.254.15.37/next/index.php/english/93-where-to-sleep
    4) User clicks on Xumec hotel article preview
    5) The Xumec article should NOT open up, but instead a new tab in the browser open us to http://www.mendozaeventos.com/lugar/976/1/xumec-apart-hotel#.UHRd4K5esbQ
    6) When the user closes the new tab that opened, the user still sees http://www.mendozaeventos.com/lugar/976/1/xumec-apart-hotel#.UHRd4K5esbQ

    I really thought this would be simple, just asking Joomla to not open the article but open a new tab with another external URL
    Any other ideas?

    Thank you

    arucardx Friend
    #469553

    Like I said, what you are looking for cannot be done perfectly without hacking the core and adding a field(extra field perhaps) in the article backend for easy management. For example if said field != empty then use this url for custom url else use article url. Something along that line.

    And to open external urls in new tab, a javascript needs to be added so every link that doesn’t match the current domain name would open in a new tab.

    You will need to pay a developer to get that kind of custom work done and I have already provided you the logical model to go about it. The fact that you think this would be a simple chore shows you do not understand how CMS works.

    seaneo Friend
    #469555

    Hi arucardx, thanks for your reply.

    “How CMS works” is a pretty broad topic LOL. For most average people who use a backend of a CMS, things are pretty straight forward and wonderful because it is a great tool for non-programmers, to put together a website. Most of you guys are very advanced coders who naturally understand more about core behavior, etc., if that’s what you meant with your statement. I am not a coder.

    The reason I though this would be easy, is because for more than 15 years now many applications (even old versions of Microsoft Word) allow you to assign a specific URL to a word or a graphic, and and then open that URL in a new window (target frame) . It is NOT a new concept or any kind of rocket science as you know. What is obvious, is that the Joomla developers did not think this would be a need, hence they did not code it into the core. This is understandable, programmers are usually very specific, especially when building something from the ground up, and heck, maybe I am the only guy who has ever questioned this, lol.

    Anyway if anybody reading this, can give me a quote for this process, with an option to assign an external URL (or not) to an article preview, please private message me. If anybody sees there could be a simpler way to do this than they way I am doing it, please let me know – thanks!

    seaneo Friend
    #469556

    Here is a correct version of the 6 steps I need to happen, the last step had an error in it in post # 4

    1) User is at http://173.254.15.37/next

    2) User clicks the menu item on the left side of the screen “Where to sleep”

    3) User now see this: http://173.254.15.37/next/index.php/english/93-where-to-sleep

    4) User clicks on Xumec hotel article preview

    5) The Xumec article should NOT open up, but instead a new tab in the browser open up to http://www.mendozaeventos.com/lugar/976/1/xumec-apart-hotel#.UHRmduTLT0Q

    6) When the user closes the new tab that opened, the user still sees http://173.254.15.37/next/index.php/english/93-where-to-sleep

    HeR0 Friend
    #469720

    Hi Guys
    In extra url, you should try using Redirect component in Joomla 2.5.x which is way easier. Have you guys ever checked that out yet? 🙂

    Regards,

    seaneo Friend
    #469767

    Hi Hero,

    thanks for the tip

    i created a redirect:

    source url:
    http://welcometomendoza.com/next/index.php/english/93-where-to-sleep/17868-xumec-hotel

    destinationa url:
    http://www.mendozaeventos.com/lugar/976/1/xumec-apart-hotel

    and this is what is happening:
    at home page user clcks on “where to sleep” on left menu
    user then clicks on xumec hotel
    the first response from ja wall is “no more posts to display”
    and when user clicks again on xumec, it just opens the article

    am i doing something wrong?
    i also notice there is no option to open a new tab with the destination url in the reirect componet.

    thoughts?
    thanks in advance

    arucardx Friend
    #469824

    That redirect component was meant for catching and redirecting error pages. I don’t think it was meant to redirect a valid page as joomla loves to do overwrites. So most likely joomla detects the link as a valid article link and took precedence over the redirect rule.

    As for why ja wall display the message “no more posts to display”, it’s because there’s no more content to load on that page? That is a correct behavior.

    seaneo Friend
    #469827

    Thanks arucardx, it all sounds logical –

    HeRo, is this what you meant in your post #8? Because unfortunately it doesn’t solve my problem, I was really hoping for a redirect as I described it.

    Nikita from SimpleRedirect said she could what I need done, without changes to the Joomla core but just changes to the template, but she could not do it until next week.

    Is there anybody available to help me with this right now – it’s a hot one – thank you in advance,

    HeR0 Friend
    #469873

    Hi Guys
    As @arucardx is right.
    However you only must has small customize Redirect plugin to work as your purpose.
    Pls read help of Redirect component :
    First ensure that you have enabled the option Use Apache mod_rewrite in the Global Configuration options of your Joomla! installation. Note that just enabling the Use Apache mod_rewrite option is not enough. You must also take the additional step of renaming the htaccess.txt file in the web server directory where you installed Joomla! to .htaccess or to whatever file name your Apache web server requires for additional configuration directives. In the Apache configuration file this setting is named ‘AccessFileName’ and by default this is set to ‘.htaccess’
    I just customized plugins/systemredirectredirect.php file , could you like try it?

    Regards


    1. redirect.zip
    seaneo Friend
    #469907

    Thanks HeRo,

    1) I looked through all 5 tabs in Global configuration and can’t find “Use Apache mod_rewrite in the Global Configuration options of your Joomla! installation” – where is it?

    2) I located the .htaccess.txt file in the /public_html/next folder – but I am not clear which to rename it to?

    3) So after I solve question 1 and 2, I download the redirect file you posted and install it and try again?

    Hopefully you can help me answer these 3 questions, let me know – thank you!

    arucardx Friend
    #469909

    I don’t really like to provide customization code anymore since nobody likes to share their JA Wall experience or customization, but I’ll do a last favor and provide you the code since it could be reused for other purposes and others can benefit from it as well.

    This only applies to Joomla because you’re using Joomla articles. K2 requires a different set of code.
    1) Go to article manager, add/edit an article.
    2) Look under metadata options, there should be a field called “External Reference”.
    3) No idea why Joomla has that field but it’s not used for anything, so let’s put the external URL in there.

    Now, we need to modify the template file to call this field and extract the URL that was entered. For anyone else reading this, you can enter other values in this field as well and use the value to perform checks, so you can use it to do something else if you get my drift =)

    Open com_contentcategoryblog_item.php and find this line of code:

    $xclass = $metadataParams->get('xclass');

    That’s for extended classes and below there, we will call add another line of code to call the value of “External reference”. So it looks like this

    $xclass = $metadataParams->get('xclass');
    $xref = $metadataParams->get('xreference');

    Now we have placed the url in the variable $xref so let us create a check to to determine the article link if $xref is not empty. Still in blog_item.php find this block of code. I’ll give the example for readmore button.

    <p class="readmore">
    <a href="<?php echo $link; ?>" title="<?php echo $atitle ?>" class="item-link">

    Now we’ll create the check and replace that block of code with this

    <p class="readmore">
    <?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; ?>

    Now it will check if “External Reference” is empty. If it’s not empty, it will use the url as the article’s link and open in a new tab. Note that I have remove class=”item-link” so it won’t open in pop up. But if “External Reference” is empty, it will use the default article link =) That should do what you want to perfectly and it’s very flexible to make or add additional changes.

    Edit: Opps, I see that Hero has posted a solution while I was preparing mine xD. Well, since I’ve already written it, I’ll just let you decide which to use. Both methods have it’s pros and cons, and I’m only providing the sample code for readmore. While Hero’s solution is more complete.

    seaneo Friend
    #469913

    Hi Arucardx,

    I like your solution because it’s taking advantage of a an existing field and utilizing it, but most importantly, it’s code changes that I can follow! ;)…you say there are some cons? what are they?

    Meanwhile, I am making these code modifications right now and should have a result shortly, will advise – thanks again!

    PS – I will share the JA Wall experience as much as possible, unfortunatly I cannot offer custom code though, I wish I could!

Viewing 15 posts - 1 through 15 (of 30 total)

This topic contains 30 replies, has 3 voices, and was last updated by  arucardx 12 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum