Forget "Hello world", how to run PHP w/ custom module?

Every example i see for creating custom modules makes a simple "Hello world". How do i create a more complex php custom block?

I'm tyring to replicate a scrolling calendar that i have working in Drupal 7.

Lots of php code, some javascript. Any examples ?

Thank you

Add markup to input field for prefix and suffix

Hello

I'm adding some text input fields to a node form, and setting the prefix and suffix to characters like £ and %.

My theme uses Bootstrap as the base theme and I'm basically looking to alter the markup for prefix and suffix to add the input-group-addon class and input-group class to a div surrounding the input field.

For example:

Parkinson's UK - We Won't Wait

Parkinson's UK, We Won't Wait home page

Parkinson’s UK drives better care, treatments and quality of life for people living with the condition. They work with the international research community to develop life-changing treatments, faster. And they won’t stop until they find a cure.

Sectors: 
Non-profit

302 error

I have this in my Form Submit

$locRedirect = "http://bricks.couponmicrosite.net/javabricksweb/index.aspx?o=" . $oc . "&c=" . $cc . "&p=" . $randomPIN . "&cpt=" . $contentCPT . "&ct=" . strtoupper($first_name) . "%20" . strtoupper($surname);

		$url = new TrustedRedirectResponse($locRedirect);			
		$form_state->setResponse($url);	

1) How can I get it to open the page in a new window I have $form['#attributes'] = array('target' => '_blank'); but it isn't working

Drupal 8 - VIEWS CSV export issue

I have inatalled 'Views data export' module which has also installed 'Serialization' and 'Serialization (CSV)' modules.

Created a new display 'data export' for my view and set CSV option.

Now I can see CSV icon on the bottom left of my view page.

2 issues...

a) When clicking CSV button, it tries to save a file with unknown format/extension with a name 'EXPORT'.

Adding a node to multiple menus

When editing a node you can select 1 menu location for the node to appear in, but I'd like the node to have the option to appear in two menus. For the workflow of the editors this really needs to be on the node form rather than editing the menu after adding the item.

It looks like https://www.drupal.org/project/multiple_node_menu would have done the job in 7 but doesn't exist in 8, is there any existing way to do this?

Many thanks!

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x