Joomla Change Featured field default to Yes - joomla2.5

in Joomla Add/Edit article there is a Featured field which is default selected as No I want to select Yes as default so in
joomla\administrator\components\com_content\models\forms\article.xml
I modify code as per my requirement
<field name="featured" type="list"
label="JFEATURED"
description="COM_CONTENT_FIELD_FEATURED_DESC"
default="0"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
to
<field name="featured" type="list"
label="JFEATURED"
description="COM_CONTENT_FIELD_FEATURED_DESC"
default="1"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
but it does not select Yes as default then I just change the text JYES with JNO though it swap but does not set featured field in db

You should do this both for:
[siteroot]/administrator/components/com_content/models/forms/article.xml
as for
[siteroot]/components/com_content/models/forms/article.xml
Thanks all here for the hint that made me able to solve this problem.

Change the value to a "1" in "joomla\components\com_content\models\forms\article.xml"
No need to change the text from JYES to JNO.
I have tested both in Joomla! 2.5 and 3.0, and works in both

Related

Laravel Livewre: on select change, pass the selected value into the method in wire:change

i have this select tag on Livewire component:
<select
class="form-select deliveryGuySelect"
id="order-{{THIS_NEED_TO_BE_$dg->id}}"
wire:change="assignOrder({{$order->id}})"
>
#foreach($deliveryGuys as $dg)
<option value="{{$dg->id}}" wire:key="{{$dg->id}}">{{$dg->name}}</option>
#endforeach
</select>
And I need, on assignOrder() action from select tag, to send the option value as parameter $dg->id.
How can I do that?
Livewire and Alpine together expose the $event magic action-object, which can target the option that was selected, and the value it has, by using $event.target.value
<select wire:change="setSomeProperty($event.target.value)">
<!-- Options here -->
</select>
https://laravel-livewire.com/docs/2.x/actions#magic-actions

FileZilla Server.xml is not reloading and showiing changes

I created something basic that will soon allow automatic user uploads for fileZilla, I have not yet made it general, Though what i am curious about is, Why is it that when I look back in the user table of the fileZilla GUI the new user is not being added? All i did was put the xml structure in a write function in php and changed the user from the one I made in the fileZilla GUI.
///write to xml file
$xml ='FileZilla Server/FileZilla Server.xml';
$handler = fopen($xml,'w');
fwrite($handler,'<FileZillaServer>
<Settings>
<Item name="Admin port" type="numeric">14147</Item>
</Settings>
<Groups />
<Users>
<User Name="ddf">
<Option Name="Pass">B7B5349BC807B2C385478AA02C2ADDCEA37F3330994D15457C8CB5ED378EF9C7D0E64D5366048AEFEF8F2424662B25A1025D863ACB5F39093BA04091BE510412</Option>
<Option Name="Salt">)W5#&apos;jgXQ5^&p2F$Wa2V2F4~RG^Ox9.J24H(:LB)i;M[BbQ8<m,J52#Jt$!8Ms/.</Option>
<Option Name="Group"></Option>
<Option Name="Bypass server userlimit">0</Option>
<Option Name="User Limit">0</Option>
<Option Name="IP Limit">0</Option>
<Option Name="Enabled">1</Option>
<Option Name="Comments"></Option>
<Option Name="ForceSsl">0</Option>
<IpFilter>
<Disallowed />
<Allowed />
</IpFilter>
<Permissions>
<Permission Dir="C:\Users\greatness\Desktop\New folder">
<Option Name="FileRead">1</Option>
<Option Name="FileWrite">0</Option>
<Option Name="FileDelete">0</Option>
<Option Name="FileAppend">0</Option>
<Option Name="DirCreate">0</Option>
<Option Name="DirDelete">0</Option>
<Option Name="DirList">1</Option>
<Option Name="DirSubdirs">1</Option>
<Option Name="IsHome">1</Option>
<Option Name="AutoCreate">0</Option>
</Permission>
</Permissions>
<SpeedLimits DlType="0" DlLimit="10" ServerDlLimitBypass="0" UlType="0" UlLimit="10" ServerUlLimitBypass="0">
<Download />
<Upload />
</SpeedLimits>
</User>
</Users>
</FileZillaServer>
');
}
////////////////////////////////////////
Afaik, FileZilla Server does not reload the configuration when you change the file.
The FileZilla Server interface uses Admin interface port of FileZilla Server to notify it about a change to make it reload the configuration.
You might be able to implement the same. See AdminSocket class in FileZilla Server repository.

Joomla Template Paramenter Type Menu Assignment

I use Joomla 3.2.1.
I create a new template and add some configuration parameter.
Now I need in my advanced configuration a selection, where I can set the menu assignment for a slideshow in my template. The Slideshow is html / javascript (jquery). I can enable/disable it in configuration.
But I want to assign it to menu item. Is there a configuration parameter type for this? I couldnt find.
my configuration looks like:
<config>
<fields name="params" >
<fieldset name="advanced">
<field type="spacer" label="Slideshow" />
<field name="isSlideshow" type="radio"
class="btn-group btn-group-yesno"
default="1"
label="Slideshow">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<!-- add menu assingment-->
<field type="menut assignment???"....>
<field name="slide1" type="media" default=""
label="Slide 1"/>
<field name="slide2" type="media" default=""
label="Slide 2"/>
<field name="slide3" type="media" default=""
label="Slide 3"/>
</fieldset>
</fields>
</config>
You should create a module with the slideshow code.
Then assign the module to a position in your template, where you will include the position:
<jdoc:include type="modules" name="slideshow" />
Install the module in the slideshow position, then in the module settings, tab "Menu Assignment", choose "Only on the pages selected";
below you can tick the menu items you want it to show on.
There are a few cases where this is not sufficient, i.e. in the blog view the articles will share the same menu item, but you might want to treat them differently. You have many options here, the best is to create a different - named position in the template, and assign the modules to the appropriate one, i.e.:
<jdoc:include type="modules" name="slideshow-all" />
<jdoc:include type="modules" name="slideshow-articles" />

Joomla ACL custom actions

I'm creating a custom (1.6) component wherein users can book a camp site. Users will be required to log in if they want to use funds/credits that they already have stored. Only certain groups can use these funds/credits.
I have created an access.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<access component="com_propbooker">
<section name="booking">
<action name="booking.create" title="Book Site" description="Allows users of this group to book sites." />
</section>
</access>
and my config.xml file:
<config>
<fieldset name="API Configuration" label="API Configuration">
<field name="google_api_key" label="Google API Key" type="text" size="50" default="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</fieldset>
<fieldset name="Booking Permissions" label="Booking Permissions" description="Set Groups that can book sites">
<field name="booking_permission" label="Booking Permission" type="rules" class="inputbox" validate="rules" filter="rules" component="com_propbooker" section="booking" />
</fieldset>
</config>
It all shows up fine when I click the options button, but no changes are ever saved. It always flips back to "Inherited" when i click the "Save" button.
Thanks in advance for any insight.
Try using permissions as the fieldset name and rules as the fieldname in your config.xml.
Like this:
<fieldset name="permissions"
label="JCONFIG_PERMISSIONS_LABEL"
description="JCONFIG_PERMISSIONS_DESC" >
<field name="rules"
type="rules"
label="JCONFIG_PERMISSIONS_LABEL"
class="inputbox"
validate="rules"
filter="rules"
component="com_propbooker"
section="booking"
/>
</fieldset>
I would also consider using the section name component as it is the default naming. But your needs may be different.

Field not displaying on list with Content types Inherits="False"

I've defined a content type 'related links' and set Inherits="False" and added line to remove out-of-the-box 'title' field as I don't want it showing in the view or new/edit/display forms, see (OPTION 1) in CAML below.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- ===== Fields ===== -->
<!-- Link Category -->
<Field DisplayName="Link Category"
Name="LinkCategory"
ID="{654EAC00-342B-4176-9D91-613AD724F684}"
Group="Custom"
Overwrite="True"
Type="Lookup"
ShowField="Title"
List="Lists/LinkCategoryList"
WebId="~sitecollection" />
<!-- ===== Content Type ===== -->
<!--
Related Links
- Parent ContentType: Item (0x01)
-->
<ContentType Name="Related Links"
ID="0x0100c11a1db14e564574bc49a2aa9bf325d3"
Group="Custom"
Description=""
Inherits="False"
Version="0">
<FieldRefs>
<!-- Title (OPTION 1) -->
<RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" />
<!-- (OPTION 2)
<FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}"
Hidden="TRUE" Required="FALSE" DisplayName="_hidden" />
-->
<!-- Link Category -->
<FieldRef DisplayName="Link Category"
Name="LinkCategory"
ID="{654EAC00-342B-4176-9D91-613AD724F684}"
Required="True" />
</FieldRefs>
</ContentType>
</Elements>
This does remove the 'title' field from the content type but when I try to associate the content type with a list it does not display the 'LinkCategory' field in the view or new/edit/display forms. Why is it so?
<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint"
Title="Related Links"
FolderCreation="FALSE"
Direction="$Resources:Direction;"
Url="Lists/RelatedLinksListDefinition"
BaseType="0"
EnableContentTypes="True"
xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<!-- Related Links -->
<ContentTypeRef ID="0x0100c11a1db14e564574bc49a2aa9bf325d3" />
</ContentTypes>
<Fields>
</Fields>
<Views>
<View ...etc...>
<ViewFields>
<FieldRef Name="LinkCategory"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID"></FieldRef>
</OrderBy>
</Query>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx"
SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx"
SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx"
SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
</MetaData>
</List>
As a work around I've set Inherits="True" on the content type and used (OPTION 2) in content type CAML and that hides the 'title' field, but would really like to understand what's going on here and what's the best approach to take. Thanks in advance!
PS: This post has similar question: SharePoint 2010: RemoveFieldRef and Inherits="TRUE"
PSS: When I browse via SP Manager 2010 after deploying using OPTION 1, I get the following:
'Link Category' Field created correctly
'Related Links' Content Type created correctly with 'Link Category' field
'Related Links' list created with 'Related Links' Content Type associated
However 'Related Links' list has no reference to 'Link Category' Field.
Ok so was on my way up the garden path...
The issue why 'Link Category' Field was not being created on the 'Related Links' list wasn't related to setting Inherits="False", it was because I had not defined it in the list schema even though I'd defined it in the content type. As mentioned here:
http://msdn.microsoft.com/en-us/library/aa543576.aspx
When SharePoint Foundation creates a list instance, it includes only
those columns that are declared in the base type schema of the list or
in the list schema. If you reference a site content type in the list
schema, and that content type references site columns that are not
included in the base type schema of the list or in the list schema,
those columns are not included. You must declare those columns in the
list schema for SharePoint Foundation to include them on the list.
And here:
http://stefan-stanev-sharepoint-blog.blogspot.com/2010/03/contenttypebinding-vs-contenttyperef.html
One ugly thing about it is that you specify a site content type to be
attached to the list based on that list definition but the framework
doesn’t provision the fields in the content type if they are missing
in the list – so you need to add manually all content type’s fields in
the Fields element of the list schema file. This is actually what I
called the fields’ redefinition issue...
So duplicated Field element below from the content type definition to list schema:
<Fields>
<Field DisplayName="Link Category"
Name="LinkCategory"
ID="{654EAC00-342B-4176-9D91-613AD724F684}"
Group="Custom"
Overwrite="True"
Type="Lookup"
ShowField="Title"
List="Lists/LinkCategoryList"
WedId="~sitecollection" />
</Fields>
I can confirm that using Inherits="False" & <RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" /> does remove the title field.
Here's another good link about Inherits="False" for those who stumble upon this post.
https://sharepoint.stackexchange.com/questions/2995/mysteries-of-the-contenttype-inherits-attribute