Support

  1. dlh
  2. General
  3. Wednesday, June 26 2019, 11:05 AM
Hello,
I have a very complex and special request for you.
My website is an aviation community website.
So I would like that the users can add their aircraft models on my website. For this, I would like a page a little bit as the Topics page but I would like that the user must complete some predefined fields as 'Airline', 'Scale", "Type of aircraft', 'Livery' and of course their can upload some pictures to illustrate these models infos (see the attached image).
Do you think possible to give me some tips and give me help to create a page a little bit like this ?
I would like that each user can edit and create some models and that these models can be appear on the user's profile.
PS : I already use Topics so is it possible to create a very new page ?

Thanks so much for your understanding, your kindness and your answer.
Best regards,
Yann Arnould
Attachments (1)
Accepted Answer
admin Accepted Answer
Admin
Hi you can do this for example by adding following code at the end of file create.ctp

<script>
jQuery(document).ready(function($){
$('#title').closest('li').hide(); // Hide Title field
$('#new_field1,#new_field2,#new_field3').change(function(){
$('#title').val( $('#new_field1').val() + ' ' + $('#new_field2').val() + ' ' +$('#new_field3').val() );
});
});
</script>
Where new_field1,new_field2 and new_field3 are the column name of fields airline, type and scale
  1. more than a month ago
  2. General
  3. # Permalink
dlh Accepted Answer
Yes. I have 3 fields : airline, type and scale. How can I do to put all this 3 elements to create the title ?
  1. more than a month ago
  2. General
  3. # 1
admin Accepted Answer
Admin
Hi,
it is a required fields so the best way to do this is to hide title with CSS and fill it via javascript when you change values like aircraft-type,...
  1. more than a month ago
  2. General
  3. # 2
dlh Accepted Answer
It works perfectly! Thanks.
I also would like to hide the title field and I would like to auto-create a title with {aircraft-type} {airline} {scale}.
Ex : Airbus A380-800 Emirates 1/200
Is it possible ?
  1. more than a month ago
  2. General
  3. # 3
admin Accepted Answer
Admin
ok, then please try to change edit.ctp file with something like
<li>
<label><?php echo __('New Field')?></label>
<?php echo $this->Form->select( 'tags', array('airline 1' => 'airline 1' ,'airline 2' => 'airline 2' ,'airline 3' => 'airline 3'), array( 'value' => $topic['Topic']['new_field'] ) ); ?>
</li>

and check if after save topic it will show correct value
  1. more than a month ago
  2. General
  3. # 4
dlh Accepted Answer
Hi,
If I put in create.cp:

<li>
<label><?php echo __('New Field')?></label>
<?php echo $this->Form->select( 'tags', array('airline 1','airline 2','airline 3'), array( 'value' => $topic['Topic']['new_field'] ) ); ?>
</li>

and in view.ctp:

<?php echo $topic['Topic']['new_field']?>

It displays the number of the selection (ex : airline 1 -> 0, airline 2 -> 1, airline 3 -> 2).
Do you have the solution to display 'airline 1', 'airline 2' and 'airline 3' instead of '0', '1', '2' ?
Thanks.
  1. more than a month ago
  2. General
  3. # 5
admin Accepted Answer
Admin
Hi you can use a code like
<?php echo $topic['Topic']['new_field']?>
  1. more than a month ago
  2. General
  3. # 6
dlh Accepted Answer
Content Protected
  1. more than a month ago
  2. General
  3. # 7
admin Accepted Answer
Admin
Yes, this is possible, like my previous reply (https://www.easy-profile.com/support/create-a-special-page-for-a-collection-part.html#reply-25073) you can add a dropdown field with a code like:
<li>
<label><?php echo __('New Field')?></label>
<?php echo $this->Form->select( 'tags', array('airline 1','airline 2','airline 3'), array( 'value' => $topic['Topic']['new_field'] ) ); ?>
</li>
  1. more than a month ago
  2. General
  3. # 8
dlh Accepted Answer
Is it possible (inside the create page) to display a drop down select field with some selections (ex : the list of the airlines and the user select which airline it is). Then I would like to display it inside the view.ctp (ex : Airline : {airline from the drop down select field).
Thanks for your answer and your kindness.
Best regards,
Yann Arnould
  1. more than a month ago
  2. General
  3. # 9
admin Accepted Answer
Admin
Hi,
after some research, unfortunately this is not possible with a simple way.
Anyway you can use the already built-in uploader and customize the view to show image where you prefer. The view file is Topics->view.ctp
Attachments (2)
  1. more than a month ago
  2. General
  3. # 10
admin Accepted Answer
Admin
Hi,
sorry for late reply, we are finding a solution for you. Today we will come back with a solution ;)
  1. more than a month ago
  2. General
  3. # 11
dlh Accepted Answer
That's perfect ! Thanks ! I have one more request.
I would like to put among the fields one field which is a image. I want that the user can upload an image of his model and that it displays in the "article". But I don't want to upload an image inside the text block. Is it possible to upload it in a specific field ?
Thanks a lot for your answer.
  1. more than a month ago
  2. General
  3. # 12
dlh Accepted Answer
I would like to put among the fields one field which is a image. I want that the user can upload an image of his model and that it displays in the "article".
Thanks a lot for your answer.
  1. more than a month ago
  2. General
  3. # 13
dlh Accepted Answer
That's perfect ! Thanks !
I have one more request.
  1. more than a month ago
  2. General
  3. # 14
admin Accepted Answer
Admin
This is a table in your database. You can add a column with a tool like phpMyAdmin, normally it is provided by your hosting provider.
  1. more than a month ago
  2. General
  3. # 15
dlh Accepted Answer
Thanks for your answer.
Where can I find #__jsnsocial_topics ?
  1. more than a month ago
  2. General
  3. # 16
admin Accepted Answer
Admin
Hi,
Unfortunately you cannot add fields to Topics natively, anyway to add a field you can follow these steps:
1) Create column in table #__jsnsocial_topics for example "new_field" (VARCHAR)
2) Create the input field in the html
- Access to Admin Panel (http://docs.easy-profile.com/index.php/article/social-network-configuration)
- Go to Theme Manager
- Choose "SocialNetwork Theme"
- Choose the file to override from left menu (Topics->create.ctp)
- Click on button "Copy" and copy it in "Blue Theme"
- Come back to Theme Manager and choose "Blue Theme"
- You will see your override to customize.
- In this new file you can add something like this after line 75 to create the new input
<li><label><?php echo __('New Field')?></label>
<?php echo $this->Form->text('new_field', array('value' => $topic['Topic']['new_field'])); ?>
</li>

3) Delete folder "cache" at /plugins/jsn/socialnetwork/app/tmp/

NOTE 1: You can do this for each new fields
NOTE 2: this modification will be still active when you update the plugin in future (layout changes is a theme override, so it will be not rewritten)
  1. more than a month ago
  2. General
  3. # 17
  • Page :
  • 1


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

Request Support

Support is currently Offline

Support Availability

Working days: Monday to Friday. The support staff is not available on weekends; in the most of cases tickets will not be answered during that time.

Reply time: Depending on the complexity of your support issue it's usually between a few minutes and 24 hours for paid members and about one week for free members. When we expect longer delays we will notify you.

Guidelines

Before you post: read the documentation and search the forums for an answer to your question.

When you post: include Site Details if you request a support (you can use the form below the reply in Site Details tab).

Auto Solved Question: If after a week the author of the post does not reply to a request by moderator, the question will be marked as resolved.

Language: only English

Search Users

Easy Profile® is not affiliated with or endorsed by Open Source Matters or the Joomla Project. Joomla is Free Software released under the GNU/GPL License.