It seems that the "Include Articles" setting overrules the "Include Article Categories" ??
I would like to show the PDF options on some articles across different categories, and I would like to show the PDF option for all articles in some other categories (Not selected single articles included in this particular category) - is that not possible ??
Selecting articles / categories for PDF
-
- Phoca Professional
- Posts: 115
- Joined: 22 Mar 2015, 00:18
- Contact:
- Jan
- Phoca Hero
- Posts: 48401
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Selecting articles / categories for PDF
Hi, both parameters work the same way:
- if you exclude article and Phoca PDF gets ID of article and sees, it is excluded, then the PDF is not displayed
the same for category:
- if you exclude category and Phoca PDF gets ID of category and sees, it is excluded, then the PDF is not displayed
Article rule applies first but in fact this has no influence on the feature. Even if this will applied as second, it will work the same.
Jan
- if you exclude article and Phoca PDF gets ID of article and sees, it is excluded, then the PDF is not displayed
the same for category:
- if you exclude category and Phoca PDF gets ID of category and sees, it is excluded, then the PDF is not displayed
Article rule applies first but in fact this has no influence on the feature. Even if this will applied as second, it will work the same.
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Professional
- Posts: 115
- Joined: 22 Mar 2015, 00:18
- Contact:
Re: Selecting articles / categories for PDF
I do not use Exclude I only use include as I wrote. But I still do not see the PDF button in the articles of the included category??
- Jan
- Phoca Hero
- Posts: 48401
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Selecting articles / categories for PDF
Hi, sorry for misunderstanding. Yes, in this case, article is the priority but it only applies when the parameter has some data. If not, it is ignored. So it does not influence category.
Try to disable SEF and check if the category ID in URL address is really same as the one set in parameters.
Jan
Try to disable SEF and check if the category ID in URL address is really same as the one set in parameters.
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Professional
- Posts: 115
- Joined: 22 Mar 2015, 00:18
- Contact:
Re: Selecting articles / categories for PDF
It is the same category in the URL catid=121 which is set in the PDF settings. The PDF button IS shown on the articles whos ID I have set, but NOT on articles from this category.
- Jan
- Phoca Hero
- Posts: 48401
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Selecting articles / categories for PDF
Hi, now I understand, If you have set some IDs for article include, all others will be ingored and this happens befor it checks the category ID.
So then the only way is to customize the code directly:
administrator/components/com_phocapdf/helpers/phocapdf.php function getPhocaPDFContentIcon
and change the behaviour there
Jan
So then the only way is to customize the code directly:
administrator/components/com_phocapdf/helpers/phocapdf.php function getPhocaPDFContentIcon
and change the behaviour there
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Professional
- Posts: 115
- Joined: 22 Mar 2015, 00:18
- Contact:
Re: Selecting articles / categories for PDF
That is sad - could this not be implemented in the future? So that it both takes full categories and seperate articles from other categories ? So that the category field overrides the article field - wouldn't that make sense ?
- Jan
- Phoca Hero
- Posts: 48401
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Selecting articles / categories for PDF
Hi, do you know PHP? If you are able to set the rules differently, just let me know the code, so I can implement it in next version. The problematic part is, that it depends on specific using of this feature. For someone will be important to check the articles first, for someone to check the categories first
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Professional
- Posts: 115
- Joined: 22 Mar 2015, 00:18
- Contact:
Re: Selecting articles / categories for PDF
Line 51 and on change to:
Code: Select all
$include_article = true;
$include_category = true;
if (!empty($include_articles)) {
if(isset($item->id) && !in_array($item->id, $include_articles)) {
$include_article = false;
}
}
if (!empty($include_categories)) {
if(isset($item->catid) && !in_array($item->catid, $include_categories)) {
$include_category = false;
}
}
//If neither article id nor category id is included return ""
if(!($include_article || $include_category)){return "";}
- Jan
- Phoca Hero
- Posts: 48401
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Selecting articles / categories for PDF
Hi, great, thank you, please test and let me know:
https://github.com/PhocaCz/PhocaPDF/rel ... 0Beta4.zip
Jan
https://github.com/PhocaCz/PhocaPDF/rel ... 0Beta4.zip
Jan
If you find Phoca extensions useful, please support the project