drupal 7 popup window (or how to show links disabled) - popup

I'm just starting drupal and I have a question. I have a main menu but some links/sections have no content yet, and I want to show a pop up window with a 'coming soon' legend when the user clicks it. However the only module that might help does not work with D7 yet and I don't know if there's a way to do it manually.
If it weren't possible, is there a way to have these links without content still appear but have them disabled so users can't click them?

I haven't tested it but this might help you:
drupal_add_js('window.open(url, "name", "height=512, width=512").focus();',
array('type' => 'inline', 'scope' => 'footer', 'weight' => 5));
http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_add_js/7

Related

Add some list to feuser on back end

feuser edit page screenshooteScreenshote
Hello, everybody. Can somebody tell me how I can add some list to feuser page on back end? Like it shown on screenshot(list with users). I want to add similar tab with user comments to feuser edit page on back end. So I want to show so user comments. Don't advice other variants please, tell me please how to do it please, if is it possible.
I want to add my table to user edit page, see screenshot, and show rows which relate to this user
TYPO3 7.6.16
You can add any table to Web module page view, via ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables']['tx_myext_domain_model_name'] = [
'default' => [
'MENU' => 'LLL:EXT:tx_myext/Resources/Private/Language/locallang_db.xlf:menuDefault',
'fList' => 'title,description,image',
'icon' => TRUE
]
];
Clear cache, and your done. Adapt listed fields (fList) depend on your needs.

How should I embed a paragraph in a Symfony2 form?

I use the Symfony2 form component to create a registration form and I just want to add a paragraph saying the user must understand terms of service above the submit button.
Should I create a ParagraphType and use it in the controller or override the submit button's block and add the paragraph in the template?
Neither of these suits me. Is there a better solution?
Thanks!
Without breaking the form into separate fields using form_widget for each field so you can inject a paragraph between the later part of the form and the submit button, you are restricted to using only form elements, meaning you can either create a special Form Type or use a form element. So under that logic, you can just make the "I understand the terms of service" a part of the form itself!
$builder->add('tos', 'checkbox', array(
'label' => 'I agree with the Terms of Service',
'required' => true,
));
Easy fix, just don't add submit button as field of form and manually render it in view. This way, you can add also some paragraph before it.

Facebook feed dialog - customizing lower left icon/text

How do you customize the text in the lower-left hand corner in the Facebook Feed Dialog, as shown in the attachment? Or is that text part of the icon? If so, then where do you upload the icon in Facebook? Haven't had any luck finding directions.
You just have to use actions parameter in your Feed Dialog code to make such text appear below the icon as you have mentioned. Check out the feed dialog parameters here
You have not mentioned anywhere in the question, which language are you using, but if you are using-
Javascript SDK-
actions: {
name: 'Join dropbox',
link: 'http://url.com'
}
PHP SDK-
'actions' => json_encode( array(
'name' => 'Join dropbox',
'link' => 'http://url.com'
))
Hope that helps! :)

Zend Navigation: defining an active branch for an action which is utside the navigation hierarchy

I have a presistent requirement which causes me problems when using Zend Navigation. A simplified example would be a system which has a database entity like "albums", for which the user needs a "list", "add", "edit" and "delete" page. The "list" and "add" pages are included in the menu system, but the "edit" and "delete" pages, being specific to an particular "album" are linked to from the "list" page.
The issue is that navigating to an "edit" or "delete" page causes the "albums" menu branch to go inactive. Obviously this is because those pages are not in the navigation hierarchy.
I'm looking for:
A good way to put these pages in the navigation hierarchy, but not display them.
A way to define the currently active branch from within the controller, so that I can keep the appropriate branch of the menu active.
A method I have not thought of which accomplishes this.
Thanks
OK One possible solution found since posting the question going down route 1 from the above potential approaches.
When creating the menu container use the 'visible'property e.g
array(
'label' => 'Edit Vehicle',
'action' => 'update',
'controller' => 'vehicle',
'route' => 'update-vehicle',
'visible' => false
),
...
for each page that should be in the menu for the purposes of generating appropriate "is active" behaviour but is not appropriate to be displayed.
Then in the partial generating the menu test
$page->isVisible
and react accordingly. But is this the prescribed method?

Customize form to make it multipaged

A module I am using provides a single paged configuration form. But for my additional configuration purposes, I am attempting to make it multipaged with one additional page for collecting extra configuration data.
I am implementing hook_form_alter and I included the following code:
$form['next'] = array(
'#type' => 'button',
'#value' => t('next'),
'#page callback' => array('custom_ucreate_profile2'),
'#button_type' => 'button',
);
I have also created the custom_ucreate_profile2 menu link. The configuration page at the end of that link works fine. But the problem is when I click on the "next" button, the current page just reloads and do not navigate to custom_ucreate_profile2.
Instead of rolling your own solution, which can be hard to maintain as time goes on, you could try the field_group module. There's even a video showing how to use the multipage features.