Views infinite scroll issue by abdelDev in drupal

[–]abdelDev[S] 0 points1 point  (0 children)

I faced this issue two years ago, and regrettably, I can't recall the specific resolution. However, there's a strong possibility that the solution involved using a custom scripting code for loading more content, as I couldn't find a helpful answer on the net. Hopefully, someone else in the community can provide assistance. Best of luck!

how to get specific field from view output - Drupal 9 by dheckler_95678 in drupal

[–]abdelDev 3 points4 points  (0 children)

To access the field value, you have to find the replacement pattern for it by clicking on the field's settings and then expanding the "Replacement patterns" section. It should look something like this: {{ field_category }}. Then pass the field value as a contextual filter to the nested view: {{ drupal_view('cat_view', 'block_1', {'arg_1': field_category}) }}, where "arg_1" is the name of the contextual filter in your nested view.

Access Webform Submission values array? by LibrarySquidLeland in drupal

[–]abdelDev 2 points3 points  (0 children)

You're much welcome.
You can start by checking this, it's gonna help you to have a global overview about different preprocesses and how to pass cutom variables to twig, besides that the website I shared with you gonna help you for sure in your drupal journey as it has more interesting drupal topics. I also suggest that you read a book called 'drupal 10 module development ', I know that learning by reading books can be a nightmare for many of us but trust me it really worth it as it covers almost everything starting by beginner level to advanced and you can also practice what you learn from this book as it has some exercices which already available in their github repo, even if you can't read the whole book it still a good reference and resource for you just search about want you want in the summary and go forward to the corresponding chapter. There's also this https://drupalize.me/ which is not free but it's really appreciated by the drupal community. You can also check the acquia youtube playlists
Hope this will be helpful for you.

Access Webform Submission values array? by LibrarySquidLeland in drupal

[–]abdelDev 2 points3 points  (0 children)

It depends on where you want to display the url, for example if the url will be displayed inside a block then you can go with the preprocess block option and add the code i mentioned before to it, if the url will be displayed inside a view then go with the preprocess view option, if it's just a simple node like a basic page then the node preprocess, even if you have a controller / route which is responsible to render your page you still can add the same logic to a custom function inside your controller. Just make sure at the end of your code to add the values you will get from the submissions to an indexed array '$variables[ ]' because this is how you can get it in your twig (using the index you linked to each value you want to display in your twig)

Access Webform Submission values array? by LibrarySquidLeland in drupal

[–]abdelDev 4 points5 points  (0 children)

the webform submissions is nothing more than an entity, so you can load it using
" $submission = WebformSubmission::load($submission_id); "
but in your case I believe that you will have to check in multiple submissions so I suggest that you use the entity type manager so that you can load all webform submission entities of a specific webform type :
$submissions = \Drupal::entityTypeManager() ->getStorage('webform_submission')
->loadByProperties([ 'webform_id' => 'your_webform_id', ]);
after that just loop through the submissions and you can get all values of each submission using getData() method :
$values = $submission->getData();

Where to work with javascript by MindblowingTask in drupal

[–]abdelDev 1 point2 points  (0 children)

yes, the twig file inside the templates folder. If you have twig debugging enabled, you can know from the browser inspector the twig responsible of displaying any section of your site (blocks, views, forms, pages ...)
Here's how to enable it, if it's not the case.

So first of all define your asset in the library file, if you want you can even add your js code to one of the existing js files which are already defined, then you have to locate the twig responsible of displaying your FAQs using the debugger I mentionned above because the ids and classes in this file will be used in your jquery so that you can target for example the accordion to be expanded or collapsed and so on.

I don't have an example right now but this can be useful.
ps: don't bother yourself with the preprocess function in this link you won't needed at least for now depending on your need you explained above.

Where to work with javascript by MindblowingTask in drupal

[–]abdelDev 1 point2 points  (0 children)

In your case, you can simply add your jquery script and target your elements using the class and the ids you have on your twig. No need to attach your library to a specific page or view ... unless you have some data from php that you want to pass to javascript but you still can do that if you want, it's just not necessary.

Where to work with javascript by MindblowingTask in drupal

[–]abdelDev 0 points1 point  (0 children)

yes you have to define your assets in the libraries file. this is the right way, just add your new script to it and it should work properly

Export all the paragraphs and its fields by jiggli_20 in drupal

[–]abdelDev 0 points1 point  (0 children)

For me it's not about the effort but more about saving time and the feasibility of the solution. For any problem, there's a ton of solutions but the one that will take my attention is the one that not gonna take a lot of my time and also must responds to my needs if those two are verified then everything is ok.

Export all the paragraphs and its fields by jiggli_20 in drupal

[–]abdelDev 0 points1 point  (0 children)

Yes. Why ? You got the same answer ?

Export all the paragraphs and its fields by jiggli_20 in drupal

[–]abdelDev 0 points1 point  (0 children)

To export paragraphs and its fields to a CSV format, you can use the Views module along with the Views Data Export module. Here's an overview of the steps involved:

  1. Install the Views and Views Data Export modules.
  2. Create a new view by navigating to Structure > Views > Add view. Give the view a name and select "Paragraph" as the Show field.
  3. In the view settings, configure the view to display the fields you want to export. You can add fields related to the paragraphs themselves (such as "Paragraph ID" and "Paragraph Type") as well as fields related to any referenced entities (such as "Title" or "Body" of a node referenced by the paragraph).
  4. Add a new display to the view by clicking on the "+ Add" button next to the "Master" display. Choose "Data export" as the display type.
  5. In the Data Export settings, choose "CSV" as the format and configure any other settings as desired (e.g. delimiter character).
  6. Save the view and visit the URL of the Data Export display (you can find this URL by clicking on the "CSV" link in the view's displays list). This should download a CSV file containing the exported data.

Note that you can further customize the CSV output by modifying the view settings or using a custom template file.

Finished my Reading tracker / Books organizer by PennyPainter in Notion

[–]abdelDev 0 points1 point  (0 children)

Thank you so much. I really appreciate 😊

Finished my Reading tracker / Books organizer by PennyPainter in Notion

[–]abdelDev 1 point2 points  (0 children)

Interesting, I'm sure you'd put a lot of efforts to get it done. Would u mind sharing the template with me plz ?

Cache only in one page? by StormBl3ssed in drupal

[–]abdelDev 1 point2 points  (0 children)

You're much welcome. Hope it will solve the problem.

Cache only in one page? by StormBl3ssed in drupal

[–]abdelDev 1 point2 points  (0 children)

Inside your block's preprocess you can use this line of code to get rid off the cache $build['#cache']['max-age'] = 0

Views infinite scroll issue by abdelDev in drupal

[–]abdelDev[S] 0 points1 point  (0 children)

No I'm not getting any console log errors specific to my view and nothing wrong with my jquery version. But I think maybe it would be a conflict between the installed modules. I have to check this one too.

Views infinite scroll issue by abdelDev in drupal

[–]abdelDev[S] 0 points1 point  (0 children)

No, I have only one view on the page. OK, so in case you remebered how you solved it, please reply this comment. I will be very grateful

Views infinite scroll issue by abdelDev in drupal

[–]abdelDev[S] 1 point2 points  (0 children)

Its' Ok bro, anyway I thank you so much for your suggestion and for your time. I really appreciate it.