link a dropdown to joomla articles

tutux

Member
Hi,

I have a dropdown of countries... i created one joomla article for each countries... so my question, is how to link all my countries to the good country article?

i know that it is in the php code in form plug-ins but i don't know how make this code...

Have you got an idea?

best regards
tutux
 
Instead of a dropdown, you need to use a databasejoin element, connected to the jos_content table.
I guess all these articles are in a dedicated category, so in the databasejoin element, you can filter to display only the articles from this category.
 
Thank you for your answer....

Ah yes a database join... whynot, mybe it's the good way :)

i will explain more :

I Have 250 differents Joomla articles. So almost one per country.All this articles are in a special categorie.
I have a databasejoin with the list of this 250 coutries.

I want that the user select the country and go directly in the article page.

...sorry to be painfull ;)
 
it is always less painful when people explain what they want to acheive...

If it is not a problem to have a dropdown with 250 values, then the easiest is to created a new form in Fabrik (you don't need a list since you will not store data in the database, unless you want to keep track of the searches) that will be used as search form.

In this form, you really only need one element : a databasejoin element to the jos_content, filtering on the category that holds your "country articles". The "value" of the join element is set to "id" while the "label" is set to "title" (providing that the title of the article is the name of the country).

Say this element is called "article_id", you then add a redirect plugin to your form and set the jump URL to (without the quotes) "index.php?option=com_content&view=article&id={___article_id_raw}" (if you record the data into a table, the placeholder will be {tablename___article_id_raw}).
 
thank you for your help !!

the problem is that without joomla samples articles, there is nothing in the jos_content table...

the "250 country list" is a fabrik list... where you have just : France, spain, italy etc...
if i link my database element to jos_content, the user have the title of the samples articles... but not the "250 country list"...

so i have to link a fabrik database (in fact my database element) with joomla articles...
so 250 id(fabrik list) to 250 another id(joomla articles)...

:)
 
I try another way, to enter 250 countries in a label dropdown list with in value the url article page... but after many hours on forum, i didn't find a php code to gat the value and redirect it....
 
Not sure what you want to do.
In your first post you say you've created one article for each country, so why is nothing in jos_content?

If you don't want to link your databasejoin directly to jos_article add an element josarticle_id to your country list and fill it, then set your databasejoin element to
value= josarticle_id
label = country

and redirect as jfquestiaux told you.
 
Hi everybody, and thank you a lot for all your nice help :)

i was exited to try as soon as possible your posts...

So, i checked it and the articles are on pteih_content table... i did what JFQUESTIAUX said : a "article_id" element with "id" as value and "title" as label. I went to form options and choiced "redirect" plugin and wrote :
index.php?option=com_content&view=article&id={___ article_id_raw}
and tried too
index.php?option=com_content&view=article&id={pteih_content___ article_id_raw}
i select "new page" instead "popup" and nothing run : 404 - Article not found

i tried to change the options but nothing better too :(

Thank you TROESTER for your idea... it's so logic... i don't why i didn't think it before ;)

do i something wrong?

thank you so much for your precious help !! ;)
 
index.php?option=com_content&view=article&id={___article_id_raw}
This should do (3 underscores, no blank)

After the redirect the URL should look like e.g.
index.php?option=com_content&view=article&id=15
 
If it were clear from the beginning that your "joomla articles" were indeed "Fabrik records" we could have avoided a lot of confusion.
But in both cases, you need to have a seperated form to use as search form. Is it the case? Does it record to a database? Can you post the list of the elements of this form?
 
i checked it
the URL is ww.mysite.com/index.php/en/titre/read-articles?id={___article_id_raw}&country_redirection___id=51&country_redirection___date_time=2012-12-13+18%3A32%3A00&country_redirection___article_id[value]=247

but always error 404
You may not be able to visit this page because of:

  1. an out-of-date bookmark/favourite
  2. a search engine that has an out-of-date listing for this site
  3. a mistyped address
  4. you have no access to this page
  5. The requested resource was not found.
  6. An error has occurred while processing your request.
 
If the generated URL is showing {___article_id_raw} then ___article_id_raw is not the full element name of the element in your search form.
Go to the element list and copy/paste the element name.

If your form is reporting to the database the element name looks like table___element (maybe "country_redirection___article_id"?)

Edit: seems your have enabled "append JumpURL with data"; you don't need to.

Just set URL to
index.php/en/titre/read-articles?id={country_redirection___article_id}
 
Can you post also a screenshot of the settings of your redirect form, in addition to the other thing I asked.
 
to jfquestiaux,

yes you right, sorry for that ...

I made an article : country choice with a form "country redirection" {fabrik view=form id=115} with the database : recorded in country_redirection database
this form have an id, a date and the article_id

@TROESTER
i have copy/paste it :

i have now :
http://www.mysite.com/index.php/en/titre/read-articles?id={___country_redirection___article_id}&country_redirection___id=55&country_redirection___date_time=&country_redirection___article_id[value]=247

and

http://www.mysite.com/index.php/en/titre/read-articles?id={pteih_content___country_redirection___article_id}&country_redirection___id=54&country_redirection___date_time=&country_redirection___article_id[value]=247
 
mysite.com/index.php/en/titre/read-articles/en/titre/read-articles?id=Welcome%20to%20the%20USA%20Web%20Pages&country_redirection___id=60&country_redirection___date_time=&country_redirection___article_id[value]=37
 
mysite.com/index.php/en/titre/read-articles/en/titre/read-articles?id=37&country_redirection___id=62&country_redirection___date_time=&country_redirection___article_id[value]=37

:(
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top