Troubleshooting Joomla Page Click

Good day everyone,

I recently got a task from a client who exclusively requested for a Joomla! Website. Unfortunately, I am not a joomla person but I accepted the job. Being a very fast learning person, I was able to understand and find my way around Joomla CMS by reading some guide about it online and I was able to give my client the design he requested for.

However, I encountered a problem. The problem is that once I create a post and publish, the post link (all links in between the <body>...</body> are not working.

So, I digged into to the template codes to troublshoot it. Being new in Joomla, I was looking for Javascript code that disabled permalinks in the code.

I have been trying to see if I can get the following lines:

<script language="javascript">
document.onmousedown=disableclick;
status="Right Click Disabled";
Function disableclick(e)
{
  if(event.button==2)
   {
     alert(status);
     return false;  
   }
}
</script>

Unfortunately, I couldn’t find it in the .js files of the joomla template I am using. So, my question is, IS THERE ANYONE HERE That can explain to me what I can do to sort this issue out.

Thanks in anticipation.

PS: I cannot share the site url as it is being developed on localhost.

From your browser, view html source code and work backwards…

I have tried that but the js script disabling the click is not in there.

I was working with the following:

defined('_JEXEC') or die;
$images = json_decode($item->images);

$item_heading = $params->get('item_heading', 'h4');
?>
<?php if ($params->get('item_title')) : ?>

	<<?php echo $item_heading; ?> class="newsflash-title<?php echo $params->get('moduleclass_sfx'); ?>">
	<?php if ($params->get('link_titles') && $item->link != '') : ?>
		<a href="<?php echo $item->link;?>">
			<?php echo $item->title;?></a>
	<?php else : ?>
		<?php echo $item->title; ?>
	<?php endif; ?>
	</<?php echo $item_heading; ?>>

<?php endif; ?>

<?php /** For Intro Image **/ if (isset($images->image_intro) and !empty($images->image_intro)) : ?>
   <?php $imgfloat = (empty($images->float_intro)) ? $item->params->get('float_intro') : $images->float_intro; ?>
   <div class="img-intro-<?php echo htmlspecialchars($imgfloat); ?>">      
  <a href="<?php echo $item->link; ?>">      
     <img
     <?php if ($images->image_intro_caption):
        echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
     endif; ?>
     src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>      
  </a>
   </div>
<?php /** End For Intro Image **/endif; ?>

<?php if (!$params->get('intro_only')) :
	echo $item->afterDisplayTitle;
endif; ?>

<?php echo $item->beforeDisplayContent; ?>

<?php echo $item->introtext; ?>

<?php if (isset($item->link) && $item->readmore != 0 && $params->get('readmore')) :
	echo '<a class="readmore" href="'.$item->link.'">'.$item->linkText.'</a>';
endif; ?>

Now, when I publish a post, the Title of the post (which, as you already know links to the full story) is not active and such you can’t click it:

<<?php echo $item_heading; ?> class="newsflash-title<?php echo $params->get('moduleclass_sfx'); ?>">
<?php if ($params->get('link_titles') && $item->link != '') : ?>

Also, when I insert “Read More”:

<?php if (isset($item->link) && $item->readmore != 0 && $params->get('readmore')) :
echo '<a class="readmore" href="'.$item->link.'">'.$item->linkText.'</a>'; endif; ?>

The same problem persists.

In short, all links inside my article are not functioning and it is driving me nut.

Anyway, thanks for your suggestion.

Sorry about the ‘nutty’ problem.
Let me try to help. What version of Joomla are you using please?

UPDATE:
Seems you are approaching Joomla from a WP background (correct me if am wrong).
Joomla sets the title, images, introtext, and read more links for you.
All you need to put into a post is normal HTML text, not PHP codes.
Can you provide a link for me to see?

You’re right. I understood how the Joomla! TinyMCE editor works and how the article read more link works. For instance, if I try to publish an article and I use a normal HTML hyperlink using <a href="myurl">Link</a> It will not be active once I publish it. In fact, you won’t be able to click it.

I am using the latest version of Joomla.

Regarding provision of link, I won’t be able to because you will have to modify your host file to be able to access the site on the server.

Thanks for your help.

Ok.
I just wanted to view the front end, see if I could inspect the codes in my browser directly. Never mind.
When you paste the HTML codes into the editor, do you go to the source to do so, or you paste into the box?
Since you are used to HTML, I suggest you change to No Editor.
To change that, I suggest you follow these instructions below.

I am assuming you are a Super Administrator on the site:
Log into the administrator backend, and Go to Global Configuration. In the tabs you will see,

  • click the first one titled ‘Site’. Change ‘Default Editor’ to None.
  • click the ‘Text Filters’. Make sure Super Users is set to ‘No Filtering’.
  • save and close.

Test and let me know the results.

Thanks for your time.

Let me break it down to you like this. Let’s assume I need to publish an article of say 800 words.

    • I have title: THIS IS THE TITLE OF MY POST
    • I have content: Lorespum isdolopo…blah blah.

I create a new article under article manager and I put the title where it is supposed to be; and my article in the text area using the wysiwyg editor in joomla. Now, I insert “read more” option using the Joomla MCE readmore button and everything is fine and I enabled “Publish”. Then I save.

Now, when I go to the frontpage of the site, I see the article published and I see the “THIS IS THE TITLE OF MY POST” with the article showing “Read More”. In attempt to continue reading, as you’ve already knwon, I can either click on the title of the article OR click on “Read more” and what I expect is the it will open the page with full article.

This is the problem I am now facing: The title and the read more links are NOT CLICKABLE.

So, it is not that I am writing php codes or scripts in the article manager (If I am to use HTML code, I know how to switch to “Code”.

So, that’s the challenge I am facing right now.

Thanks once again.

aha…now I can understand the issue clearly.
Are ‘Linked Titles’, ‘Show IntroText’ and ‘Show Read More’ enabled inside Options?
I think the links are disabled by default.

Yes… they are enabled.

Omo e bad o. The last spot to check is in your template.
Are there any overrides in it? What is the template name? Let me check it out for you.

Here is how I solved it:

I inserted the following lines in to default.php in /html/com_content/article/default.php

<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '0')) || ($params->get('urls_position') == '0' && empty($urls->urls_position)))
	|| (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
1 Like

26 days later? If you have only just fixed this now then you might want to consider a different career…

Lol. I actually fixed it three days later… But I’ve been too much busy to post the update. I posted it because @daydah followed it up (with a private message to my inbox and I told her I will post how I fixed it).