Please note that Form2Content is no longer being developed. All files from the latest version can be found on Github.

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. imsj
  2. Form2Content Lite & Pro
  3. Monday, 07 November 2016
  4.  Subscribe via email
I am using Form2Content Pro version 6.15.0 on Joomla 3.6.4.

May I list in Article manager front-end view ONLY the unpublished items? If there are no setting available, can you provide me a line of code to insert into forms/default.php (or in any other part) to filter only unpublished articles?

Thank you.
cmc
Responses (10)
Accepted Answer Pending Moderation
Hi, we currently don't have a setting to view published items only. No one has asked for it before but I think it's something we can add to our wishlist.
I would have to ask Julien if there is a "simple" override.

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 1
Accepted Answer Pending Moderation
Can Julien suggest me something to list only unpublished items on article manager?
Thank you.
cmc
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 2
Accepted Answer Pending Moderation
Or, as an alternative, can you suggest me how to hinibit modification for published articles?
Thank you.
cmc
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 3
Accepted Answer Pending Moderation
N.B.: I am using Form2Content Pro version 6.15.0 on Joomla 3.6.4.
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 4
Accepted Answer Pending Moderation
Hi,

Filtering the articles is done in the file components/com_form2content/models/forms.php in the function getListQuery()

From line #99 onwards the state is filtered:

		// Filter by published state
if($activeMenu->params->get('show_published_filter', 0))
{
// State filter is visible
$published = $this->getState('filter.published');

if (is_numeric($published))
{
$query->where('a.state = ' . (int) $published);
}
else if ($published == '')
{
$query->where('(a.state = '.F2C_STATE_UNPUBLISHED.' OR a.state = '.F2C_STATE_PUBLISHED.')');
}
}
else
{
// State filter is not visible
$query->where('(a.state = '.F2C_STATE_UNPUBLISHED.' OR a.state = '.F2C_STATE_PUBLISHED.')');
}


This block of code takes into account whether the state filter is shown or not.
If you only need unpublished articles, you can replace the entire block with this line of code:

$query->where('a.state = '.F2C_STATE_UNPUBLISHED);


best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 5
Accepted Answer Pending Moderation
Julien,
I noticed a strange behavior. The code you suggest me work well if a "first" user call "his" content type. But if the "first" user call the content type of a "second" user, in that view all articles (published and unpublished) are shown. I have a "hierarchical" access, managed via Joomla ACL, that consent to a few users to list different content type, each one related to a different user (via menu item). It's strange, but I made several tests and this is the situation. I hope I was able to explain myself...
Do you have a solution?
Thank you.
cmc
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 6
Accepted Answer Pending Moderation
Hi,

Let me see if I get this right:

User 1 selects a menu containing an F2c Article list manager and sees unpublished items.

Then user 2 selects a different menu containing an F2c Article list manager and sees both published and unpublished items.

Is that what you mean?

best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 7
Accepted Answer Pending Moderation
Not exactly, user Lazio access Lazio and Roma content types, If userLazio access Lazio content type see unpublished, if the same user access Roma content type see all.
See attach sreenshots (I am developing on a local website).
cmc
Attachments (2)
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 8
Accepted Answer Pending Moderation
But also Roma user see all article on "its" Roma content type... It seems that published articles are hidden only if a user list its own articles.
cmc
Attachments (1)
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 9
Accepted Answer Pending Moderation
Hi,

It's hard to say why this behaviour occurs. Could you please send me an Akeeba back-up so that I can see this myself?
Please include credentials for the Lazio account.

You can send the back-up to julien at opensourcedesign dot nl

best,
Julien
  1. more than a month ago
  2. Form2Content Lite & Pro
  3. # 10
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.