Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

I want to use the pagetype==articlenew to asign a template for creating a new article. But it can't be recognized in joomla 1.5! How can I do with this problem.

tdchen
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

In Joomla 1.5 it just has a different name: it's called "articlesubmit".

So you can detect like this:

if ($core_genius->check("pagetype = articlesubmit")) return XXX;
// replace XXX with module to show on the new article page.


Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

Thank you so much Stephen.
You don't know how important you are for me.
I have tried what you told me.
But it seems not to work!
the code is:

if ($core_genius->check("pagetype = articleedit"))return "MY_ZTDK_INNER_special";
if ($core_genius->check("pagetype = articlesubmit")) return "MY_ZTDK_INNER_special";

The first one works, but the second doesn't.
I want the 2 pagetype use the same template--"MY_ZTDK_INNER_special"
I don't know where the problem is? I use The Version:MetaTemplate 1.13 (30 May 2011)

Following are the 2 urls:
(task=edit)
http://localhost/new1/index.php?view=article&id=69%3A2010-07-26-01&task=edit&ret=aHR0cDovL2xvY2FsaG9zdC9uZXcxL2luZGV4LnBocD9vcHRpb249Y29tX2NvbnRlbnQmdmlldz1jYXRlZ29yeSZpZD00MCZJdGVtaWQ9Njg%3D&option=com_content&Itemid=68

(task=new):
http://localhost/new1/index.php?task=new&ret=aHR0cDovL2xvY2FsaG9zdC9uZXcxL2luZGV4LnBocD9vcHRpb249Y29tX2NvbnRlbnQmdmlldz1jYXRlZ29yeSZpZD00MCZJdGVtaWQ9Njg%3D&id=0&sectionid=8&option=com_content&Itemid=68

tdchen
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

[moved this topic to the ChameleonLite forum instead of the MetaMod forum]

Hi tdchen,

It's funny - on my test Joomla installation, when I click on a menu item for submitting (making) a new article, the URL is:

http://localhost/index.php?option=com_content&view=article&layout=form&Itemid=51&lang=en

Therefore, JomGenius detects the option, view and layout parameters in order to detect that it's a form for submitting a new article.

So, where do your URLs come from? They're definitely different to mine. Are they from a menu item for submitting new content? Or somewhere else?

Do you have any other components installed that might be messing with this? e.g. I seem to remember MyBlog uses com_content but in a strange way... maybe that's what's creating the URLs?

I want to know where the URLs are coming from so that I can work out if JomGenius needs to include detection of this new type of URL, or not.

Meanwhile, for your case you could just use:

if ($option == "com_content" and JRequest::getVar("task") == "new") return "MY_ZTDK_INNER_special";

Lastly, I'd advise you to upgrade to ChameleonLite instead of MetaTemplate. It got renamed about a month ago, and all the upgrades and new features are happening to ChameleonLite. You can install it on top of MetaTemplate which should migrate your existing rules, then you can delete MetaTemplate.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

Hello metamodguy:
I must have done something wrong.
The (JRequest::getVar("task") == "new") still not work!
The funny url comes when:
0)you enabled the login module in your front end page.
1)you logged in as an administrator from the front end, so you have the right of editting.
2)you select a menu that is going to list something(e.g. news list).
3)Then you can see a editing button at the end of each item.
4)At the same time you can see a "create "link at the end of the list.
When you clicked the "create"link , the url comes out.
I don't know whether it is clear?
Anyway,It's a problem when you create an article from the front end.
Thank you so much metamodguy.

tdchen
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

It works!
I copyed your code then paste it: It works!
I typed your code: It doesn't work!
I cann't recover what I had typed. So I donn't know the exact error.
Thank you so much metamodguy!

tdchen
Beginner Modder
ranks
useravatar
Offline
7 Posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

Hi,

thanks for the information about where that other link appears. I'll look at this next week and incorporate the new situation into JomGenius.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

Hi tdchen,

I just released a new version of Chameleon and ChameleonLite today that has better detection of the articlesubmit pages. Thanks for pointing me in the right direction - I had never noticed that link for submitting a new article that appears at the bottom of a section list, and it has a different style of URL.

So anyway, the original code I suggested should work fine now:

if ($core_genius->check("pagetype = articlesubmit")) return XXX;
// replace XXX with module to show on the new article page.

(J1.5 only - for J1.7 change articlesubmit to articlenew)

Thanks for reporting it!

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

After installing meta-template on the host and on insertion of PHP code into a rule i encountered an error.
Forbidden
You don't have permission to access /administrator/index.php on this server.
Why is it so?

alexnikol
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: joomla1.6 has pagetype: articlenew, but I use joomla 1.5!!!

Hi Alex,

MetaTemplate has now been upgraded to Chameleon (& ChameleonLite). Can you please upgrade your version to the latest available from this site, and try again?

Please also include the following information:
- Joomla version
- Chameleon version
- perhaps a screenshot of the error occurring, as you haven't described exactly when the error occurs. e.g. is it in the back end? Or the front end?
- what rule were you creating? Did it have PHP code in it?

I wonder at the moment if you might have some security installed on your server (e.g. suhosin or mod_security or some sort of Joomla security software) that is detecting that you have done a POST request that includes PHP code in it, and is blocking it. Can you please check into that as well?

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10783
Newest User:
weatti4qx
Members Online:
0
Guests Online:
238

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked