How do I link to an Anchor in an article?

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Thorsten
Posts: 14567
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I link to an Anchor in an article?

Post by Thorsten » Thu Jul 29, 2010 7:46 am

Hi,

I'll check thi issue.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

Lidio
Posts: 25
Joined: Mon Dec 10, 2007 9:26 pm

Re: How do I link to an Anchor in an article?

Post by Lidio » Tue Aug 03, 2010 4:51 pm

Thorsten wrote:Hi,

I'll check thi issue.

bye
Thorsten
Hi Thorsten,

here is my patch for consideration.

in inc/link.php added fragment test and save the fragment

Code: Select all

    protected function getHttpGetParameters()
    {
        $query      = $this->getQuery();
        $parameters = array();

        if (!empty($query)) {
            if ( isset($query['fragment']) ) {
            	$parameters[self::PMF_LINK_FRAGMENT_SEPARATOR] = urldecode($query['fragment']);
            }
            $params = explode(self::PMF_LINK_AMPERSAND, $query['main']);
            foreach ($params as $param) {
                if (!empty($param)) {
                    $couple           = explode(self::PMF_LINK_EQUAL, $param);
                    list($key, $val)  = $couple;
                    $parameters[$key] = urldecode($val);
                }
            }
        }

        return $parameters;
    }
in public function toString(...) added check for fragment and append to new url

Code: Select all

                        case self::PMF_LINK_GET_ACTION_ARTIKEL:
                            $url .= self::PMF_LINK_CONTENT.$getParams[self::PMF_LINK_GET_CATEGORY].self::PMF_LINK_HTML_SLASH.$getParams[self::PMF_LINK_GET_ID].self::PMF_LINK_HTML_SLASH.$getParams[self::PMF_LINK_GET_ARTLANG].self::PMF_LINK_SLASH.$this->getSEOItemTitle().self::PMF_LINK_HTML_EXTENSION;
                            if (isset($getParams[self::PMF_LINK_GET_HIGHLIGHT])) {
                                $url .= self::PMF_LINK_SEARCHPART_SEPARATOR.self::PMF_LINK_GET_HIGHLIGHT.'='.$getParams[self::PMF_LINK_GET_HIGHLIGHT];
                            }
                            if ( isset($getParams[self::PMF_LINK_FRAGMENT_SEPARATOR]) ) {
                                $url .= self::PMF_LINK_FRAGMENT_SEPARATOR.$getParams[self::PMF_LINK_FRAGMENT_SEPARATOR];
                            }
                            break;
Regards,

Lidio.

Thorsten
Posts: 14567
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I link to an Anchor in an article?

Post by Thorsten » Tue Aug 03, 2010 7:01 pm

Hi,

I reviewed your patch and it looks good. I'll add it to 2.6.8. Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

hprosupp
Posts: 7
Joined: Tue Nov 28, 2017 2:35 pm

Re: How do I link to an Anchor in an article?

Post by hprosupp » Tue Nov 28, 2017 2:41 pm

Hi,

I have the same issue on my fresh from today install (2.9.9 on CentOS 7)

When i edit my article it sounds ok but when i'm on my faq the link is http://my.domain.name/faq/#anchor and obviously it doesn't work.

mod_rewrite is disabled

can someone help ?

Best regards,

Hprosupp

Thorsten
Posts: 14567
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I link to an Anchor in an article?

Post by Thorsten » Tue Nov 28, 2017 8:57 pm

Hi,

how do you add the anchors?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

hprosupp
Posts: 7
Joined: Tue Nov 28, 2017 2:35 pm

Re: How do I link to an Anchor in an article?

Post by hprosupp » Thu Nov 30, 2017 11:37 am

Thorsten wrote:
Tue Nov 28, 2017 8:57 pm
Hi,

how do you add the anchors?

bye
Thorsten
Hi,

I'm using the editor : Insert > Anchor after selecting my text

And then i use the "link" tool on the top content of my page

hprosupp
Posts: 7
Joined: Tue Nov 28, 2017 2:35 pm

Re: How do I link to an Anchor in an article?

Post by hprosupp » Tue Dec 05, 2017 7:16 am

Anyone can help ?

Thorsten
Posts: 14567
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I link to an Anchor in an article?

Post by Thorsten » Fri Dec 08, 2017 10:24 pm

Hi,

I'll check it.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

hprosupp
Posts: 7
Joined: Tue Nov 28, 2017 2:35 pm

Re: How do I link to an Anchor in an article?

Post by hprosupp » Fri Dec 29, 2017 7:12 am

Thorsten wrote:
Fri Dec 08, 2017 10:24 pm
Hi,

I'll check it.

bye
Thorsten
Hi, have any answer for me ?

Thorsten
Posts: 14567
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: How do I link to an Anchor in an article?

Post by Thorsten » Fri Dec 29, 2017 8:29 am

Hi,

not yet.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

hprosupp
Posts: 7
Joined: Tue Nov 28, 2017 2:35 pm

Re: How do I link to an Anchor in an article?

Post by hprosupp » Tue Jan 02, 2018 12:13 pm

Hi,

So what can i do ?

Best regards and happy new year !

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests