Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 53308

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

0 votes
1 answer
143 views

How do I programmatically create a view whose structure is defined at runtime?

I know I am able to create a view programatically here: "How do I programatically create a view?" - only this requires knowing the structure of the view (e.g. which fields / filters / relationships to …
James Alvarez's user avatar
1 vote
Accepted

How do I programmatically create a view whose structure is defined at runtime?

Ok - no answers and I've figured out two ways to do this. 1. hook_views_default_views() One way is to define the view in hook_views_default_views() and then to rest the cache for instance with vie …
James Alvarez's user avatar
0 votes
1 answer
24 views

Is it possible to have an entity with fields, which doesn't use bundles? [duplicate]

I have an entity (using entity API) for which I would like a fixed number of fields (and would prefer to use fields and the API rather than just creating properties) - it makes no sense to make a bund …
James Alvarez's user avatar
2 votes

Multiple values in creating a new field instance

Hopefully this will prove useful: To create a field that allows multiple values, you set the cardinality to -1 when using field_create_field. Then all instances will allow multiple values (provided t …
James Alvarez's user avatar
1 vote
1 answer
44 views

How do I programatically create and display a one-off view?

I am programmatically generating views based on an entity with varying fields and saving them with $view->save(). Just to be clear, I have to do this because my entities have x-amount of fields, and …
James Alvarez's user avatar
0 votes
Accepted

How do I programatically create and display a one-off view?

I figured it out myself in the end - by looking at how Views does it itself in views_block_view(). function page_callback($my_entity) { //create view $view = new view(); ... //Do all the vi …
James Alvarez's user avatar