equipment – How would closing borders and supply routes affect local market prices?

I’m developing a world where governments are freaking out over a perceived threat (not a virus). The stars have disappeared and the gods have seemingly abandoned them. Many leaders have ordered their borders locked down and trade routes closed for various reasons.

Different countries would have the resources they can produce themselves (obviously) but things from outside would be increasingly scarce as time goes on. I know that not having shipments to a desert country would raise the price of the remaining wood products in their markets. But I don’t know how much. I know what each country produces and what they import.

My question:
What is a reasonable scale for increasing scarcity?

I’m mostly looking for a realistic percentage I can add to market prices every week/month to reflect the scarcity. But if a set scale is more realistic let me know.

P.S.
I know my PCs will be able to exploit this with smuggling and get “hella rich” as they would put it. But in the long run if they waste their time smuggling they will come to the inevitable end of the campaign with too much money and not enough power. I’m letting them know it’s on a timeline so they can make their own decisions.

theming – How can I customize the 403 page for specific routes?

On a D9 site, with an existing custom 403 page twig. I’ve been requested to show a different, variable, message from the “standard one” for a couple of specific routes.

I’ve tried with theme_preprocess_page__403(&$variables) but I couldn’t determine the original route.

E.g. using Drupal::routeMatch()->getRouteName() I got system.403 instead of the route name I need to check. I’ve checked solutions to find the refer route but none of them seemed to work.

Actually the two routes that need this specific 403 are created programmatically with a *routing.yml and relative controller in a custom module.

I wonder if it is possible somehow to specify the redirect path if the route requirements fails. I didn’t find any documentation about, but that would another way to implements this requirement.

theming – 9 – How customize 403 page for some routes?

On a D9 site, with an existing custom 403 page twig. I’ve been requested to show a different, variable, message from the “standard one” for a couple of specific routes.

I’ve tried with theme_preprocess_page__403(&$variables) but I couldn’t determine the original route.

E.g. using Drupal::routeMatch()->getRouteName() I got system.403 instead of the route name I need to check. I’ve checked solutions to find the refer route but none of them seemed to work.

Actually the two routes that need this specific 403 are created programmatically with a *routing.yml and relative controller in a custom module.

I wonder if it is possible somehow to specify the redirect path if the route requirements fails. I didn’t find any documentation about, but that would another way to implements this requirement.

htaccess – Only expose routes with prefix /wp-json on WordPress using Apache

Pretty straightforward:

I want to only expose routes with the /wp-json prefix so that I can use headless WordPress without exposing the rest of my WordPress site to the internet.

I’m running this on Apache, but haven’t yet figured out the proper syntax for .htaccess.

So far I have tried:

<Directory />
    AllowOverride None
</Directory>
<Directory /wp-json*>
    AllowOverride All
</Directory>
<Directory /wp-json*/*>
    AllowOverride None
</Directory>

and

<Directory "/wp-json/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from all
</Directory>

My .htaccess is located inside of the public_html root directory. I’m not sure if I’ve got the .htaccess in the wrong directory or, if the syntax I’m using just isn’t working. Any tips?

routes – Add paragraph in page

I’ve created a page with the drupal custom routing

my_module.select:
  path: '/select'
  defaults:
    _title: 'select'
    _controller: 'Drupalmy_moduleControllerSelectController::index'
  requirements:
    _permission: 'access content'

I’d like to add my paragraph into this page. Is it possible to do this from the backend ?

routing – On premise SpamTitan appliance injecting IP routes

We recently migrated to a new firewall and most things were okay apart from email flow. There was a queue on SpamTitan which wouldn’t release. When I checked the routing table, rather than using the default gateway it had been routing directly to the old firewall (rather than to the core L3 switch). The only way to fix it was to reboot the appliance. However, it’s still bypassing the default gateway and going directly to the new firewall. The SpamTitan support guys couldn’t see anything wrong with the appliance and suggested there was some dynamic routing going in. There isn’t, it’s just statically set everywhere.

The setup is:

SpamTitan (192.168.1.6)–>Core L3 Switch (192.168.1.50)–>Firewall (192.168.1.70)

Routing table image as I can’t format it in the text below

The current routing table is this:

Internet:
Destination Gateway Flags Netif
default 192.168.1.50 UGS em0
1.68.169.119 192.168.1.70 UGHD em0
1.119.129.17 192.168.1.70 UGHD em0
1.186.104.237 192.168.1.70 UGHD em0

I tried to find out what the flags mean, but I couldn’t find any explanation of what they mean in practice, just a copy and pasted definition of what they mean.

Day-to-day it causes no issue, but if I need to make changes at the core level, then the SpamTitan box is just going to ignore this (and possibly some other appliances)?

routes – How to add custom URL for node/add/{custom-content-type} in Drupal 8?

I have custom content type which I fill up with the help of Multistep Form(used contributed module called Froms Stpes).

Now I want to set custom url for Node/add/{custom-content-type}, I tried to use alterRoute method in RouteSubscriber as below:

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) { 
     if ($route = $collection->get('node.add_page')) {
         $current_uri = Drupal::request()->getRequestUri();
         if($current_uri=="node/add/custom-content-type") {
            $route->setPath('/Custom-content/add');
         }
            
      
      }
  }

But above code is not changing the URL, also I am finding it difficult to apply condition that URL should change only for custom content type.

Please Help

colors – What is the best way to display multiple routes on a map overlapping eachother?

I’m in need of some HCI advice.

Here is what my current implementation of a ‘best path between multiple required vertices’ looks like:
graph

Black is the start vertex, green is the end vertex, and blue are the ‘inbetween’ vertices that must be visited.

I have added an alpha of 70% to different coloured paths, obviously that hasn’t helped distinguish the different routes between each vertex.

What would be the optimal way to display these routes at the same time, so that someone can distinguish the route from 1 to 2, and 3 to the last vertex?

How can I get a route’s name if I have the route object?

I have a route object (which may not be the current route’s object) and I need to get the route’s name, e.g. entity.node.canonical. I don’t see any method to get the name directly from the object, nor do I see it anywhere when I inspect the object via Xdebug.

I know that I can easily get the name of the current route with $current_route_name = Drupal::routeMatch()->getRouteName(), but how can I get the name of an arbitrary route, if I have the route object.

routes – permissions for fillpdf URL

I’m using the FillPDF module and the FillPDF online service to render the PDFs. Everything works fine provided I’m logged in as the site admin; however, when I’m logged in as a std. user, I get an access denied when I click on the fillpdf link.

The link looks like:
/fillpdf?fid=4&entity_id=entity_name:659441

I have not created a route for this URL but I’m thinking that’s what I need to do? Am I on the right track?

Thanks,
P