Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last month.
Improve this question
I got a website (Typo3 9.5) already configured with existing typoscript and a bunch of pages.
Now I want to create an extension which simply adds one line of code to every page when a checkbox in the backend for this specific page is set.
Like a "Show Editor [x]" checkbox which then adds a simple fixed to this exact page.
I know there must be an easy way to get this to work but I have no idea how to do it.
Right now I'm thinking about manipulating the PAGE object in Typoscript and just add a on 10000000 with all the needed variables inside. But there must be a better way.
Your Requirements are actually multiple tasks which can be seperated:
Backend UI
Fetching the Editor of the Page
display that data in the frontend
Backend UI
adding a checkbox to the TYPO3 Backend requires you to add TCA Overrides to define an addtional field for the pages table. and and ext_tables.sql to adapt the database schema (you need to store this value in the database)
Fetching the Editor of the Page
what is the editor of the page? is it the "author" field of the page record? the user who initally created the page? the person who created the most content elements on the page? this of course has to be solved by you.
in the similes way its just text field and you can use it right away in the typoscript for more complex scenarious you might create a viewHelper, dataProcessor or userFunc to resolve the Author.
display that data in the frontend
you now should have somehow fetched the user. and you need to "insert" it at the correct place in you page template. if its just a simple value it should be straight forward adapting add it to your typoscirpt PAGE object. or FLUIDTEMPLATE
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
In my Symfony 4 project, I have a Validator entity that contains the 'order' and 'user' fields that refer to a user of my User entity.
The goal is to allow the site administrator to establish a list of users who can validate certain requests from other users, but with a specific order.
For example, the admin would establish the following list:
1. Philippe Dupont
2. Julia Robert
3. Joseph Dupuis
He would have the possibility on the page to dynamically add elements, or to change the order of the validators as he wishes by passing Joseph Dupuis in 1st position for example.
So, it would look a little like what we see on this page using a jQuery plugin
https://symfony-collection.fuz.org/symfony3/
(But I'm under Symfony 4 )
Image of what I want
The goal being the submission of the form to be able to obtain in this case 3 validator objects that will contain the correct order (1,2,3) with the right User elements according to what has been entered. And everything will be spent on the BDD.
Except that in addition to being able to do that, it would be necessary that on each fields text, there is an automatic filtering on the complete name of the user with each modification of the field.
So I would like to have your help to know how I should go about doing all this. Is this plugin the right solution? Is it easy to set up on Symfony 4? Ability to add a filter effect?
Thanks for your help !
Take what you want to do a step at a time. You are asking for 2 different things here, and there isn't a pre-built javascript library that will do both.
Start with creating your "Validator" input form form. It sounds like select2.js will help you with your auto-complete request. Your User field would be a EntityType or ChoiceType.
Then move on to creating a collection of these forms following the Symfony docs. The collection script you linked should work with Symfony 4 with tweaking, as form collections really didn't change much between 3.x and 4.x.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
We have a website running Drupal. Our API to which our website will pass information to will get content articles from specific tables We need to know what table/ tables the content articles are stored.
Open PhpMyAdmin and check it out. Basic table is "node", but for every additional field you create in your content type Drupal creates new table(s).
My advice is not to write custom queriess but to use Views module (and some of it's submodule, i.e. Views data export) to get data and create export feed - would make your life much easier. Or use some specialized module for generating feeds, like...hmmm Feeds.
https://www.drupal.org/project/views
https://www.drupal.org/project/views_data_export
https://www.drupal.org/project/feeds
This all depends on what fields your articles have.
The node id and its most basic information is saved in the node (nid, title, status,created,changed, type and user)
Then every field you add will create a new table for it's data so for example
if you have the fields with the machine names subtitle and website you will need to join the tables "field_data_field_subtitle" and field_data_field_website".
If you that keep in mind that each field can have its own fields for data for example if the website field is an url field it will have field_website_url and field_website_title and feild_website_attributes to contain the data for that field.
Furthermore fields like references to taxonomies will only contain a target_id so you will need to join the taxonomy table as well.
Of course the question is why do you want to do custom queries (which i advice not to) i advice you to look into EntityFieldQuery in which you don't have to figure out what tabels to join. Or take a look at the views module in which you can click together what fields you want and views takes care of your joins.
I am new with Skadate, which is a dating software build in PHP 5 and template engine Smarty. I need to add an extra field for user edit section.
Currently there is default user fields in the admin section. I need to add an extra field. e.g. Country : Country list
How can I accomplish this task?
To add new profile question you have to utilize admin panel. Just go to URL www.yoursitename.com/admin/users/profile-questions
On this page you will get options for add Sections and Profile questions.
Fill up the form and save using submit button.
Regarding your query, To add a question with answer as drop down or list, you need to add them with Answer type field as drop down.
Once you create new question if your site supports multiple language then you have to put corresponding value in yoursite.com/admin/settings/languages
FYI: new questions are stored under base section.
I'm using idatemedia's dating software so there is no smarty templates. It's pretty much all straight PHP and version 7.2. I'm able to add a custom field but since I know mysql I prefer to add it via php and insert the field into the table structure. Most new fields I add are not blob text fields. They are characters of around 1000.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am creating small project managment website.
main table is projects. Also i have several table
task
discusion
milestones
all tables contain pid(project id) linked to specific row in project table. i whant to create tabs in proejcts views page, where user can see
1. task tab - all tasks attached to project
2. mileston tab -all milestones
3. dicusions tab - all dicusions
...
AND for example in task tab user will see all tasks and have possibilty to create new task, manage or delete (typical crud for Task model). And same for All tabs.
Problem
I dont whant to use only one controller and do that all in the ProjectController.
But how use other controller/action in projects views page
Please suggest me right way or structure
Probably your best option would be to use Ajax calls back to the appropriate controllers to load content. You could also submit forms via Ajax ...
1) Create new table CRUD using yii.
2) edit layout/config file for tab display.
3) insert link for new tab.
4) You can show as you want.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
My client is a college professor who wants to add online quizzes for his students on his Wordpress-powered website, among other things. So I'm building a custom plugin that allows him or any administrator to make these quizzes from the admin pages. All this info is saved in the mysql database in their own tables, no problem here. It's when showing the quizzes to the students/regular users of the blog that I got lost.
What I wanted was a way to generate these quizzes. At first I figured a $_GET parameter with the quiz's ID the student wants to do would do the trick, but then, where would that even go? Should I use a separate php file in the main directory of wordpress (and would that even work)?
Should I create a regular old post and slap the code with shortcodes? Should I work with custom post types? (But remember the quizzes are already created in the database and I feel making one post, custom or regular, for each quiz seems excessive and complicated. Can you even make a wordpress page dynamic and pass it a parameter?)
Or is there a way to use hooks to rewrite the main page to show my code instead of the loop (or any other place at all)? Or am I too far off and is there another method altogether?
You can do it as simply as using a custom template. For example, make a page called "Quiz" and a custom template called quiz.php. In that template you could simply look for the quiz id in the query string and then display it:
if($_GET['quiz_id']){
/** code to retrieve and output the quiz */
}
else{
/** code for them to select a quiz */
}
That's the bare bones approach. To do it in a slicker way you might use something like the rewrite endpoint API (http://codex.wordpress.org/Rewrite_API/add_rewrite_endpoint)
An example of that would be:
/** add a custom function to the init hook */
add_action('init', 'my_custom_endpoint');
/** custom endpoint for handling forms */
function my_custom_endpoint(){
add_rewrite_endpoint('forms', EP_ALL);
/** when pages are loaded, check to see if it's a form page and do something */
add_action( 'template_redirect', 'process_form' );
}
The EP_ALL is the endpoint mask -- it tells WordPress where to apply the new endpoint. You could have it apply only to pages, only to posts, etc. In this case you're adding your endpoint everywhere.
Then you have a function that actually processes the endpoint:
function process_form(){
global $wp_query;
/** check for your endpoint. A URL like site.com/forms/12 would set forms = 12 */
if(isset($wp_query->query_vars['forms'])){
/** the query var forms has a value, do something to show the form */
echo get_form($wp_query->query_vars['forms']);
}
}