This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Anchor Tags
#1

My page uses anchor tags. And when someone submits a comment, it replaces the current anchor tab with another one, and that messes up the rendering of the page.

For example, the discussion part of the page is hidden unless you click on the discussion tab, then it changes the URL to this:

http://foundingfatherquotes.com/founding...discussion

Notice that it adds the #section=discussion. Is there a way to turn off the URL rewrite when you add a new comment. Now, it will change it to this:

http://foundingfatherquotes.com/founding...#cmtx_form

Is there an easy way to modify the script so that after you submit a message, it does not add the #cmtx_form part to the script, but leaves the current anchor tag in place. Or even better, if there is a current anchor tag, go to it, if not then add the #cmtx_form tag.

I could probably figure it out if I dug into the code, but I wanted to ask the question here first.
Reply
#2

You can change the #cmtx_form value in /upload/includes/language/english/form.php on line 28.

Then (and I haven't tested this) but you could try adding some logic around that line which parses the URL to get the anchor and changes the #cmtx_form value depending on what the anchor is.

Have you completed the interview?
Reply
#3

(27-Jan-2015, 09:28 PM)Steven Wrote:  You can change the #cmtx_form value in /upload/includes/language/english/form.php on line 28.

Then (and I haven't tested this) but you could try adding some logic around that line which parses the URL to get the anchor and changes the #cmtx_form value depending on what the anchor is.

Thanks for the info. You saved me some time digging through the code. I really like the script so far. I modified the form.php with the following lines of code. The page I need to preserve the Anchor Text on was just a single page. So this was the easiest way to code it.

Code:
if ($_SERVER['PHP_SELF'] == '/father.php') { cmtx_define('CMTX_ANCHOR_FORM', '#section=discussion'); }
else { cmtx_define('CMTX_ANCHOR_FORM', '#cmtx_form'); }

BTW, thank you for the very quick response.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)