Anchor not working in BB code

Go down

Solved Anchor not working in BB code

Post by Whole India January 20th 2021, 6:18 pm

Technical Details


Forum version : #ModernBB
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : All members
When the problem appeared : Today
Forum link : https://ns-india.forumotion.com/

Description of problem

The last query which I had was regarding this only, however, the responses there helped me. The Anchors aren't working in BB code. Hence please help me.

I have checked this: https://help.forumotion.com/t33347-html-anchor-tag-problems?highlight=anchor

But it is for HTML and not BB code.


Last edited by Whole India on January 25th 2021, 3:39 pm; edited 1 time in total
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 21st 2021, 12:19 pm

Please help me.
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by TheCrow January 21st 2021, 12:51 pm

@Whole India wrote:Please help me.
@Whole India

Please don't double post. Your posts need to be separated by 24 hours before bumping. Please use the edit button, instead!
Please read our forum rules: ESF General Rules

Could you please post a picture of your problem to understand it better?

Regards,
TC.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6666
Reputation : 778
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 22nd 2021, 9:16 am

Anchor not working in BB code 2021-011

As you can see I want to do something like when we click on one of the sections we directly got to that section. So I need help in BBCode.
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by TheCrow January 22nd 2021, 10:44 am

@Whole India

I already told you how to do this in this topic: /t159910-not-able-to-make-a-table-of-content-with-link-in-it#1116017

This is working, so you should be okay with that code.
Am I wrong?

Regards,
TC.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6666
Reputation : 778
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 22nd 2021, 3:04 pm

@TheCrow wrote:@Whole India

I already told you how to do this in this topic: /t159910-not-able-to-make-a-table-of-content-with-link-in-it#1116017

This is working, so you should be okay with that code.
Am I wrong?

Regards,
TC.
I tried the Id, but it isn't working. As now I want the link at start like shown in the screenshot but linking not to a table but to a section.
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by TheCrow January 22nd 2021, 5:06 pm

Hello again,

What code are you using that isn't working?
TheCrow
TheCrow
Manager
Manager

Male Posts : 6666
Reputation : 778
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 23rd 2021, 10:15 am

I am using url for the link and Id like you told before, but it's not in table.
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by TheCrow January 23rd 2021, 11:28 am

Can you please post your code here using the code tags to have a look?

Thanks.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6666
Reputation : 778
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 23rd 2021, 7:06 pm

Code:
[b]Table of Contents[/b]

1] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#1]Introductory Statement of Purpose[/url]
2] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#2]Article 1: The Basic Provisions of the Indian Region[/url]
3] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#3]Article 2: Civil Rights of the Indian Citizen[/url]
4] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#4]Article 3: The Executive Branch[/url]
5] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#5]Article 4: The Legislative Branch[/url]
6] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#6]Article 5: The Judicial Branch[/url]
7] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#7]Article 6: Final Provisions[/url]


[center][i][b][size=18][id="1"]Introductory Statement of Purpose[/size][/b][/i][/center]
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by TheCrow January 23rd 2021, 7:46 pm

@Whole India

The bbcode
Code:
[id]
is not a valid bbcode. I'd recommend at least adding a div there just to target the wishing part using html.

Example:
Code:
[b]Table of Contents[/b]
 
1] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#1]Introductory Statement of Purpose[/url]
2] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#2]Article 1: The Basic Provisions of the Indian Region[/url]
3] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#3]Article 2: Civil Rights of the Indian Citizen[/url]
4] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#4]Article 3: The Executive Branch[/url]
5] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#5]Article 4: The Legislative Branch[/url]
6] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#6]Article 5: The Judicial Branch[/url]
7] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#7]Article 6: Final Provisions[/url]
 
 
[center][i][b][size=18]<div id="1">Introductory Statement of Purpose</div>[/size][/b][/i][/center]



Regards,
TC.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6666
Reputation : 778
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 24th 2021, 5:07 am

I tried the code, it isn't working.
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Neptune- January 24th 2021, 2:05 pm

Hello,

An id or a class should never begin with a number !

This code will work (tested myself)

Code:
[b]Table of Contents[/b]
       
      1] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Intro]Introductory Statement of Purpose[/url]
      2] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art1]Article 1: The Basic Provisions of the Indian Region[/url]
      3] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art2]Article 2: Civil Rights of the Indian Citizen[/url]
      4] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art3]Article 3: The Executive Branch[/url]
      5] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art4]Article 4: The Legislative Branch[/url]
      6] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art5]Article 5: The Judicial Branch[/url]
      7] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art6]Article 6: Final Provisions[/url]

[center][i][b][size=18]<div id="Intro">Introductory Statement of Purpose</div>[/size][/b][/i][/center]
Neptune-
Neptune-
Forumember

Male Posts : 438
Reputation : 99
Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
Location : France

View user profile https://www.galaxie-series.net/

skouliki, Niko, TonnyKamper and TheCrow like this post

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Neptune- January 25th 2021, 4:35 am

Another code without any HTML tag

Code:
        [b]Table of Contents[/b]
       
        1] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Intro]Introductory Statement of Purpose[/url]
        2] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art1]Article 1: The Basic Provisions of the Indian Region[/url]
        3] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art2]Article 2: Civil Rights of the Indian Citizen[/url]
        4] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art3]Article 3: The Executive Branch[/url]
        5] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art4]Article 4: The Legislative Branch[/url]
        6] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art5]Article 5: The Judicial Branch[/url]
        7] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art6]Article 6: Final Provisions[/url]
       

[table id="Intro" class="toc"][tr][td][/td][/tr][/table]
[center][b][i]Introductory Statement of Purpose[/i][/b][/center]
[i]We the citizens of the Region of India, to keep order and peace in this long-standing community, hereby establish this constitution as the supreme law of the region, upkeeping the legal and civil peace through the future administrations of this region; let the Constitution of India be a permanent guide to all present and future residents. We the people of India, agree to the constitution and pledge to protect and follow it.[/i]


[table id="Art1" class="toc"][tr][td][/td][/tr][/table]
[center][b][i]Article 1: The Basic Provisions of the Indian Region[/i][/b][/center]
Section 1: The Region of India is a free and open democracy, which shall be sovereign and endowed with a constitutional structure. Violation of the constitutional structure, or attempts to violate the democratic rights and freedoms this constitution endows on its citizens shall be deemed as treason against the region.
Section 2: The flag of the Indian Region shall be established through common legislation in the Parliament of India. The official flag of India shall be the official governmental seal and standard.
Section 3: The official languages of the Region of India shall be Hindi and English. The government may introduce additional recognized languages through statutory law.
Section 4: Citizenship in the Region of India shall be a constitutional institution, regulated by the Parliament of India, in coordination with the provisions of this constitution. Nations must have a world assembly member nation within the region of India in order to gain citizenship, or otherwise must provide justification to the government of India for a lack of World Assembly status. Further provisions for citizenship may be provided for in law passed by the Parliament of India.
Section 5: Any changes including the amendment, repeal, or revisal of any provision of this constitution must meet the standards imposed by the constitution. No amendment to this constitution may be made to limit or otherwise restrict the democratic freedoms of the citizens of India. Amendments to the Constitution of India must be proposed and passed by the Parliament of India in a majority vote of the body, and then must be referred to the population of India in a referendum, where the majority of the region must vote in favor of the amendment in order for such action to take effect.
Section 6: The right to vote in regional or interregional elections within the Region of India shall be limited to those nations who shall hold citizenship status, and be officially registered with the Indian government.
Section 7: The RMB is considered a public forum, and posts on this platform, or any platform administered by the Indian government, shall be protected under the freedom of speech. The government may move to suppress posts on these forums should they be deemed to violate regional security, or infringe on constitutional authority.
Section 8: Civil rights and liberties may only be restricted in times of regional emergency, or upon conviction from a recognized Indian court, or interregional court, for criminal violation. Such restrictions must be provided for in legislation from the appropriate body.
Section 9: All citizens are expected to act in good faith while exercising their rights.

Anchors are made like this :
Code:
[table  id="Intro" class="toc"][tr][td][/td][/tr][/table]
and inserted just before your section title.

problem with anchor is that it always shows on top when you load it, and top is always used with toolbar and navigation on ModernBB
To fix that, just add to your CSS the following code
Code:
.toc {
  visibility: hidden;
  margin-bottom: 60px;
}
You dont want to see the table, even if it's empty ? Visibility hidden is for that
And just change margin-bottom value to fit your needs.

Here is the result without any CSS




Table of Contents

1] Introductory Statement of Purpose
2] Article 1: The Basic Provisions of the Indian Region
3] ...
4] ...
5] ...
6] ...
7] ...


Introductory Statement of Purpose
We the citizens of the Region of India, to keep order and peace in this long-standing community, hereby establish this constitution as the supreme law of the region, upkeeping the legal and civil peace through the future administrations of this region; let the Constitution of India be a permanent guide to all present and future residents. We the people of India, agree to the constitution and pledge to protect and follow it.

Article 1: The Basic Provisions of the Indian Region
Section 1: The Region of India is a free and open democracy, which shall be sovereign and endowed with a constitutional structure. Violation of the constitutional structure, or attempts to violate the democratic rights and freedoms this constitution endows on its citizens shall be deemed as treason against the region.
Section 2: The flag of the Indian Region shall be established through common legislation in the Parliament of India. The official flag of India shall be the official governmental seal and standard.
Section 3: The official languages of the Region of India shall be Hindi and English. The government may introduce additional recognized languages through statutory law.
Section 4: Citizenship in the Region of India shall be a constitutional institution, regulated by the Parliament of India, in coordination with the provisions of this constitution. Nations must have a world assembly member nation within the region of India in order to gain citizenship, or otherwise must provide justification to the government of India for a lack of World Assembly status. Further provisions for citizenship may be provided for in law passed by the Parliament of India.
Section 5: Any changes including the amendment, repeal, or revisal of any provision of this constitution must meet the standards imposed by the constitution. No amendment to this constitution may be made to limit or otherwise restrict the democratic freedoms of the citizens of India. Amendments to the Constitution of India must be proposed and passed by the Parliament of India in a majority vote of the body, and then must be referred to the population of India in a referendum, where the majority of the region must vote in favor of the amendment in order for such action to take effect.
Section 6: The right to vote in regional or interregional elections within the Region of India shall be limited to those nations who shall hold citizenship status, and be officially registered with the Indian government.
Section 7: The RMB is considered a public forum, and posts on this platform, or any platform administered by the Indian government, shall be protected under the freedom of speech. The government may move to suppress posts on these forums should they be deemed to violate regional security, or infringe on constitutional authority.
Section 8: Civil rights and liberties may only be restricted in times of regional emergency, or upon conviction from a recognized Indian court, or interregional court, for criminal violation. Such restrictions must be provided for in legislation from the appropriate body.
Section 9: All citizens are expected to act in good faith while exercising their rights.
Neptune-
Neptune-
Forumember

Male Posts : 438
Reputation : 99
Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
Location : France

View user profile https://www.galaxie-series.net/

skouliki, TonnyKamper and Whole India like this post

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 25th 2021, 9:13 am

@Neptune- wrote:Hello,

An id or a class should never begin with a number !

This code will work (tested myself)

Code:
[b]Table of Contents[/b]
        
       1] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Intro]Introductory Statement of Purpose[/url]
       2] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art1]Article 1: The Basic Provisions of the Indian Region[/url]
       3] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art2]Article 2: Civil Rights of the Indian Citizen[/url]
       4] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art3]Article 3: The Executive Branch[/url]
       5] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art4]Article 4: The Legislative Branch[/url]
       6] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art5]Article 5: The Judicial Branch[/url]
       7] [url=https://ns-india.forumotion.com/t3-the-constitution-of-india#Art6]Article 6: Final Provisions[/url]

[center][i][b][size=18]<div id="Intro">Introductory Statement of Purpose</div>[/size][/b][/i][/center]
I tried this one, it didn't work, but the one after it worked. What is CCS by the way. I will just test the code, once it works my problem's solved.
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Neptune- January 25th 2021, 9:19 am

For the first code you need to enable HTML

CSS -> ACP > Display > Colors > CSS Stylesheet tab.

Without CSS like here, titles are hidden under toolbar and navigation. CSS fixes that
Neptune-
Neptune-
Forumember

Male Posts : 438
Reputation : 99
Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
Location : France

View user profile https://www.galaxie-series.net/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 25th 2021, 9:44 am

@Neptune- wrote:For the first code you need to enable HTML

CSS -> ACP > Display > Colors > CSS Stylesheet tab.

Without CSS like here, titles are hidden under toolbar and navigation. CSS fixes that

How to enable HTML for all? I enabled it for me but it didn't work.
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Neptune- January 25th 2021, 10:02 am

-> Enabling HTML

With HTML enabled, it becomes easier.
No need to reload the page, you skip to the anchor like on wikipedia for example.

Working code with HTML enabled (careful, former users will need to activate HTML too, but new users will get it enabled without doing anything)

Code:
                [b]Table of Contents[/b]
             
                1] <a href="#Intro">Introductory Statement of Purpose</a>
                2] <a href="#Art1">Article 1: The Basic Provisions of the Indian Region</a>
                3] ...
                4] ...
                5] ...
                6] ...
                7] ...
             
       
        [table  id="Intro" class="toc"][tr][td][/td][/tr][/table]
        [center][b][i]Introductory Statement of Purpose[/i][/b][/center]
        [i]We the citizens of the Region of India, to keep order and peace in this long-standing community, hereby establish this constitution as the supreme law of the region, upkeeping the legal and civil peace through the future administrations of this region; let the Constitution of India be a permanent guide to all present and future residents. We the people of India, agree to the constitution and pledge to protect and follow it.[/i]
       
       
        [table id="Art1" class="toc"][tr][td][/td][/tr][/table]
        [center][b][i]Article 1: The Basic Provisions of the Indian Region[/i][/b][/center]
        Section 1: The Region of India is a free and open democracy, which shall be sovereign and endowed with a constitutional structure. Violation of the constitutional structure, or attempts to violate the democratic rights and freedoms this constitution endows on its citizens shall be deemed as treason against the region.
        Section 2: The flag of the Indian Region shall be established through common legislation in the Parliament of India. The official flag of India shall be the official governmental seal and standard.
        Section 3: The official languages of the Region of India shall be Hindi and English. The government may introduce additional recognized languages through statutory law.
        Section 4: Citizenship in the Region of India shall be a constitutional institution, regulated by the Parliament of India, in coordination with the provisions of this constitution. Nations must have a world assembly member nation within the region of India in order to gain citizenship, or otherwise must provide justification to the government of India for a lack of World Assembly status. Further provisions for citizenship may be provided for in law passed by the Parliament of India.
        Section 5: Any changes including the amendment, repeal, or revisal of any provision of this constitution must meet the standards imposed by the constitution. No amendment to this constitution may be made to limit or otherwise restrict the democratic freedoms of the citizens of India. Amendments to the Constitution of India must be proposed and passed by the Parliament of India in a majority vote of the body, and then must be referred to the population of India in a referendum, where the majority of the region must vote in favor of the amendment in order for such action to take effect.
        Section 6: The right to vote in regional or interregional elections within the Region of India shall be limited to those nations who shall hold citizenship status, and be officially registered with the Indian government.
        Section 7: The RMB is considered a public forum, and posts on this platform, or any platform administered by the Indian government, shall be protected under the freedom of speech. The government may move to suppress posts on these forums should they be deemed to violate regional security, or infringe on constitutional authority.
        Section 8: Civil rights and liberties may only be restricted in times of regional emergency, or upon conviction from a recognized Indian court, or interregional court, for criminal violation. Such restrictions must be provided for in legislation from the appropriate body.
        Section 9: All citizens are expected to act in good faith while exercising their rights.
Neptune-
Neptune-
Forumember

Male Posts : 438
Reputation : 99
Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
Location : France

View user profile https://www.galaxie-series.net/

Whole India likes this post

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Whole India January 25th 2021, 3:38 pm

Thank you the problem's solved.
Whole India
Whole India
New Member

Posts : 17
Reputation : 1
Language : English

View user profile https://ns-india.forumotion.com/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by Neptune- January 25th 2021, 4:00 pm

Thank you too, now i will be able to put some anchors on an alphabetical list of topics
Neptune-
Neptune-
Forumember

Male Posts : 438
Reputation : 99
Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
Location : France

View user profile https://www.galaxie-series.net/

Back to top Go down

Solved Re: Anchor not working in BB code

Post by SLGray January 25th 2021, 8:20 pm

Problem solved & topic archived.
Please read our forum rules:  ESF General Rules


Anchor not working in BB code Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 49068
Reputation : 3418
Language : English
Location : United States

View user profile https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum